This is a string package written in go which is used to convert the strings to different case styles. The commonly used strategies are: camel case, pascal case, snake case, and kebab case.
This requires Go version 1.11 or later.
go get -u github.com/parithiban/stringcases
The following are some of the methods that can be used from the package.
ConvertToSnake Convert a string from any format to snake_case.
ConvertToKebab Convert a string from any format to kebab-case.
ConvertToPascal Convert a string from any format to PascalCase.
ConvertToCamel Convert a string from any format to camelCase.
ConvertToSnake("ConvertToSnakeCase") => convert_to_snake_case
ConvertToKebab("convert_to_kebab_case") => convert-to-kebab-case.
ConvertToPascal("convert-to-pascal-case") => ConvertToPascalCase.
ConvertToCamel("convert to camel case") => convertToCamelCase.