package
0.4.1
Repository: https://github.com/thinkgos/x.git
Documentation: pkg.go.dev

# Functions

AddSlashes returns a string with backslashes added before characters that need to be escaped.
Append appends string to slice with no duplicates.
Bytes2Str Zero-copy convert from byte slice to a string see reflect.SliceHeader and reflect.StringHeader 理论上是 string(byte{"a","b"}) 的20倍速率.
CamelCase to camel case string id_com -> IdCom idcom -> Idcom name_id_com -> NameIdCom name_idcom -> NameIdcom.
Compare compares two 'string' type slices.
CompareU compares two 'string' type slices.
Contains returns true if the string exists in given slice 字符串切片是否含有指定的元素,大小写敏感.
ContainsFold returns true if the string exists in given slice, ignore case.
Delete 删除string切片中的,第一个出现的指定元素.
DeleteAll 删除string切片中的 所有出现的指示元素.
HasChinese 字符串是否含有中文.
HasLetter 字符串是否含有(英文)字母.
HasSpecialChar 标点字符,符号字符, mark 字符.
IsASCII 是否IsASCII字符串.
IsLetter 是否是英文字母.
IsLetters 字符串是否全英文字母.
Join concatenates the elements of its first argument to create a single string.
JoinInt concatenates the elements of its first argument to create a single string.
Kebab 转换驼峰字符串为用'-'分隔的字符串,特殊字符由DefaultInitialisms决定取代 example2: delimiter = '-' initialisms = DefaultInitialisms IDCom -> id-com IDcom -> idcom nameIDCom -> name-id-com nameIDcom -> name-idcom.
LowTitle 首字母小写 see strings.Title.
NewRecode 创建一个Recode,以initialisms为自定义的Replacer example: API -> api ID -> id.
QuoteMeta returns a version of str with a backslash character (\) before every character that is among these: .
Recombine 转换驼峰字符串为用delimiter分隔的字符串 example: delimiter = '_' HelloWorld -> hello_world Hello_World -> hello_world HiHello_World -> hi_hello_world IDCom -> id_com IDcom -> i_dcom nameIDCom -> name_id_com nameIDcom -> name_i_dcom.
Reverse a utf8 encoded string.
Shuffle pseudo-randomizes the order of elements using the default Source.
SnakeCase 转换驼峰字符串为用'_'分隔的字符串,特殊字符由DefaultInitialisms决定取代 example2: delimiter = '_' initialisms = DefaultInitialisms IDCom -> id_com IDcom -> idcom nameIDCom -> name_id_com nameIDcom -> name_idcom.
Split Split slices s into all substrings separated by sep and returns a slice of the int64 between those separators.
SplitInt Split slices s into all substrings separated by sep and returns a slice of the int between those separators.
Str2Bytes Convert different types to byte slice using types and functions in unsafe and reflect package(see reflect.SliceHeader and reflect.StringHeader).
StripSlashes returns a string with backslashes stripped off.
Unique takes an input slice of strings and returns a new slice of strings without duplicate values.
UnRecombine 转换sep分隔的字符串为驼峰字符串 example: delimiter = '_' hello_world -> HelloWorld.

# Variables

DefaultInitialisms default initialism for snake case.

# Structs

Recode 重组转换一些特殊的字符.