casee
Golang liibrary for case convertion of string.
Usage
-
go get -d github.com/pinzolo/casee
. - Add
github.com/pinzolo/casee
toimport
section in your go file.
Functions
Convert functions
-
ToSnakeCase
Convert to snake_case style string. -
ToChainCase
Convert to chain-case style string. -
ToCamelCase
Convert to camelCase style string. -
ToPascalCase
Convert to PascalCase style string. -
ToFlatCase
Convert to flatcase style string. -
ToUpperCase
Convert to UPPER_CASE style string.
Check functions
-
IsSnakeCase
Check argument string is snake_case. -
IsChainCase
Check argument string is chain-case. -
IsCamelCase
Check argument string is camelCase. -
IsPascalCase
Check argument string is PascalCase. -
IsFlatCase
Check argument string is flatcase. -
IsUpperCase
Check argument string is UPPER_CASE.
If first character is digit, IsCamelCase
, IsPascalCase
and IsFlatCase
always returns false.
Because cannot judge upper or lower.