package
1.3.48
Repository: https://github.com/sandwich-go/boost.git
Documentation: pkg.go.dev

# README

xstrings

字符串辅助函数

  • 判断字符串的布尔值
  • CamelCaseSnakeCase 转换
  • JSON 校验
  • 丰富 trim
  • 首字母大小写

例子

fmt.Println(CamelCase("camel_case"))

Output:

CamelCase

# Functions

CamelCase returns the CamelCased name.
CamelCaseSlice is like CamelCase, but the argument is a slice of strings to be joined with "_".
EscapeStringBackslash escape v.
FirstLower 首字符小写.
FirstUpper 首字符大写.
From [影响性能] converts `any` to string.
HasPrefixIgnoreCase 前缀匹配.
IsASCIIDigit Is c an ASCII digit?.
IsASCIILower Is c an ASCII lower-case letter?.
IsFalse 判断command解析获取的数据是否为false.
IsTrue 判断command解析获取的数据是否为true.
SnakeCase 返回字符串的SnakeCase版本.
SplitAndTrim 将给定字符串分割并trim每一个子元素.
Trim 扩展strings.Trim功能,提供默认的mask字符.
TrimPrefixIgnoreCase 移除前缀,不区分大小写.
UglyJSON removes insignificant space characters from the input json byte slice and returns the compacted result.
ValidJSON 是否为合法json字符串.
Wrap 换行给定字符串.

# Variables

DefaultTrimChars are the characters which are stripped by Trim* functions in default.