Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CamelToSnake ¶
单词边界有两种 1. 非大写字符,且下一个是大写字符 2. 大写字符,且下一个是大写字符,且下下一个是非大写字符
Example ¶
var inputs = []string{ "XiaoMei", "xiaoMei", "HTTPStatus", "You123", "PriceP", "4sPrice", "Price4s", "goodHTTP", "ILoveGolangAndJSONSoMuch", } for i := range inputs { fmt.Println(CamelToSnake(inputs[i])) }
Output: xiao_mei xiao_mei http_status you123 price_p 4s_price price4s good_http i_love_golang_and_json_so_much
func FirstLetterToLower ¶
Example ¶
fmt.Println(FirstLetterToLower("abc")) fmt.Println(FirstLetterToLower("Abc"))
Output: abc abc
func FirstLetterToUpper ¶
Example ¶
fmt.Println(FirstLetterToUpper("Abc")) fmt.Println(FirstLetterToUpper("abc"))
Output: Abc Abc
func SnakeToCamel ¶
Example ¶
var inputs = []string{"xiao_mei", "http_status", "you123", "price_p"} for i := range inputs { fmt.Println(SnakeToCamel(inputs[i])) }
Output: XiaoMei HttpStatus You123 PriceP
func ThousandSep ¶
func ThousandSep(value interface{}) string
func ThousandSplit ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.