go-strings
常用函数
字符串分割
1 | sub := strings.Split(title, " ")//将字符串按空格分割 |
字符串拼接
1 | strings.Join(sub, " ") |
将字符串转为小写
1 | s = strings.ToLower(s) |
将字符串转为大写
1 | s = strings.ToUpper(s) |
将字符串首字母转为大写
1 | s = strings.Title(s) |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.