Documentation ¶
Index ¶
- func CharLength(s string) int
- func GBK2UTF8(str []byte) (b []byte, err error)
- func IsPalindrome(word string) bool
- func MD5(b []byte) string
- func MD5Str(s ...string) string
- func PadLeft(s string, width int, pad rune) string
- func PadRight(s string, width int, pad rune) string
- func Reverse(s string) string
- func SimpleSimplifyWhitespace(s string) string
- func SimplifyWhitespace(s string) string
- func SimplifyWhitespaceWithReg(s string) string
- func Snake2Camel(s string, title bool) string
- func ToString(v interface{}) string
- func UTF82GBK(str []byte) (b []byte, err error)
- func UUID() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsPalindrome ¶ added in v0.0.2
IsPalindrome 判断一个单词是否回文单词 思路:第一个字符和倒数第一个字符比较是否相等,第二和倒数第二比较,依次比较 有一个不相同就不是回文,否则,则是
func PadLeft ¶ added in v0.0.2
PadLeft 使用指定字符 pad 从左侧填充补齐字符串 s 到 width 指定的字符长度 example: PadLeft("test", 7, '*') = `***test`
func PadRight ¶ added in v0.0.2
PadRight 使用指定字符 pad 从右侧填充补齐字符串 s 到 width 指定的字符长度 example: PadRight("test", 7, '*') = `test***`
func Reverse ¶ added in v0.0.2
Reverse returns its argument string reversed rune-wise left to right.
func SimpleSimplifyWhitespace ¶ added in v0.0.2
SimpleSimplifyWhitespace 去掉 s 首尾空白字符,且将 s 中间出现的空白字符(包括换行、tab键、多个空格)用一个空格替换
func SimplifyWhitespace ¶ added in v0.0.2
SimplifyWhitespace 去掉 s 首尾空白字符,且将 s 中间出现的空白字符(包括换行、tab键、多个空格)用一个空格替换 比 SimpleSimplifyWhitespace() 更高效
func SimplifyWhitespaceWithReg ¶ added in v0.0.2
SimplifyWhitespaceWithReg 使用正则替换 s 中间的空白字符为一个空格
func Snake2Camel ¶
Snake2Camel 蛇形下划线格式转驼峰 若 title == true,转成大驼峰,即:"under_score" -> "UnderScore"; 否则 -> "underScore"
Types ¶
This section is empty.