Documentation ¶
Index ¶
- func AddSlashes(s string) string
- func Append(strs []string, str string) []string
- func CamelCase(str string) string
- func Compare(s1, s2 []string) bool
- func CompareU(s1, s2 []string) bool
- func Contains(sl []string, str string) bool
- func ContainsFold(sl []string, str string) bool
- func Delete(s []string, e string) []string
- func DeleteAll(s []string, e string) []string
- func HasChinese(str string) bool
- func HasLetter(str string) bool
- func HasSpecialChar(str string) bool
- func IsASCII(str string) bool
- func IsGoInternalType(t string) bool
- func IsGoKeywords(t string) bool
- func IsLetter(r rune) bool
- func IsLetters(str string) bool
- func Join(elems []int64, sep string) string
- func JoinInt(elems []int, sep string) string
- func Kebab(str string) string
- func LowTitle(s string) string
- func Map(ss []string, mapping func(string) string) []string
- func Mapx(ss []string, mapping func(string) string) []string
- func QuoteMeta(s string) string
- func Recombine(str string, delimiter byte) string
- func Reverse(n int, f func(from, to int))
- func ReverseString(s string) string
- func Shuffle(str string) string
- func SmallCamelCase(fieldName string) string
- func SnakeCase(str string) string
- func Split(s, sep string) []int64
- func SplitInt(s, sep string) []int
- func StripSlashes(s string) string
- func UnRecombine(str string, delimiter byte) string
- func Unique(a []string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddSlashes ¶
AddSlashes returns a string with backslashes added before characters that need to be escaped. 使用反斜线引用字符串,对' " \转义.
func CamelCase ¶
CamelCase to camel case string id_com -> IDCom idcom -> Idcom name_id_com -> NameIDCom name_idcom -> NameIdcom
func Compare ¶
Compare compares two 'string' type slices. It returns true if elements and order are both the same. 比较两个字符串切片,要求元素和顺序都一致才返回true
func CompareU ¶
CompareU compares two 'string' type slices. It returns true if elements are the same, and ignores the order. 比较两个字符串切片,要求元素一致,且忽略顺序,一致返回true
func ContainsFold ¶
ContainsFold returns true if the string exists in given slice, ignore case. 字符串切片是否含有指定的元素,忽略大小写
func IsGoInternalType ¶ added in v0.0.5
IsGoInternalType 是否是Golang内部类型
func Join ¶
Join concatenates the elements of its first argument to create a single string. The separator string sep is placed between elements in the resulting string.
func JoinInt ¶
JoinInt concatenates the elements of its first argument to create a single string. The separator string sep is placed between elements in the resulting string.
func Kebab ¶
Kebab 转换驼峰字符串为用'-'分隔的字符串,特殊字符由DefaultInitialisms决定取代 example2: delimiter = '-' initialisms = DefaultInitialisms IDCom -> id-com IDcom -> idcom nameIDCom -> name-id-com nameIDcom -> name-idcom
func QuoteMeta ¶
QuoteMeta returns a version of str with a backslash character (\) before every character that is among these: . \ + * ? [ ^ ] ( $ ) 转义元字符集,包括 . + \ ( $ ) [ ^ ] * ?
func Recombine ¶
Recombine 转换驼峰字符串为用delimiter分隔的字符串, 特殊字符由DefaultInitialisms决定取代 example: delimiter = '_' 空字符 -> 空字符 HelloWorld -> hello_world Hello_World -> hello_world HiHello_World -> hi_hello_world IDCom -> id_com IDcom -> idcom nameIDCom -> name_id_com nameIDcom -> name_idcom
func ReverseString ¶ added in v0.0.3
Reverse a utf8 encoded string.
func SmallCamelCase ¶ added in v0.0.5
SmallCamelCase to small camel case string id_com -> idCom idcom -> idcom name_id_com -> nameIDCom name_idcom -> nameIdcom
func SnakeCase ¶
SnakeCase 转换驼峰字符串为用'_'分隔的字符串,特殊字符由DefaultInitialisms决定取代 example2: delimiter = '_' initialisms = DefaultInitialisms IDCom -> id_com IDcom -> idcom nameIDCom -> name_id_com nameIDcom -> name_idcom
func Split ¶
Split Split slices s into all substrings separated by sep and returns a slice of the int64 between those separators.
func SplitInt ¶
SplitInt Split slices s into all substrings separated by sep and returns a slice of the int between those separators.
func StripSlashes ¶
StripSlashes returns a string with backslashes stripped off. (\' becomes ' and so on.) Double backslashes (\\) are made into a single backslash (\). 使用反斜线反引用字符串,对 \' \" \\反转义.
func UnRecombine ¶
UnRecombine 转换sep分隔的字符串为驼峰字符串 example: delimiter = '_' 空字符 -> 空字符 hello_world -> HelloWorld
Types ¶
This section is empty.