Documentation
¶
Overview ¶
Package stringcase implements utility functions for changing the case of simple strings.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToCamel ¶
ToCamel converts a string to camelCase.
Example ¶
fmt.Println(ToCamel("camel case"))
Output: camelCase
func ToKebab ¶
ToKebab converts a string to kebab-case.
Example ¶
fmt.Println(ToKebab("kebab case"))
Output: kebab-case
func ToSnake ¶
ToSnake converts a string to snake_case.
Example ¶
fmt.Println(ToSnake("snake case"))
Output: snake_case
func ToUpperCamel ¶
ToUpperCamel converts a string to UpperCamelCase (aka PascalCase).
Example ¶
fmt.Println(ToUpperCamel("upper_camel_case"))
Output: UpperCamelCase
func ToUpperKebab ¶
ToUpperKebab converts a string to UPPER-KEBAB-CASE.
Example ¶
fmt.Println(ToUpperKebab("upper kebab case"))
Output: UPPER-KEBAB-CASE
func ToUpperSnake ¶
ToUpperSnake converts a string to UPPER_SNAKE_CASE.
Example ¶
fmt.Println(ToUpperSnake("upper snake case"))
Output: UPPER_SNAKE_CASE
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.