Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Capitalize ¶
Capitalize capitalizes the first letter of a given string and converts the rest to lowercase. Example: "example" -> "Example"
func SplitWords ¶
SplitWords splits a string into words based on transitions between alphanumeric and non-alphanumeric characters, as well as transitions between lowercase and uppercase characters. Example: "ThisIsATest" -> ["This", "Is", "A", "Test"]
func ToCapWords ¶
ToCapWords converts a given string to capitalized words, handling initialisms correctly. Example: "thisIsATest" -> "ThisIsATest"
func ToConstantCase ¶ added in v0.0.2
ToConstantCase converts a given string to CONSTANT_CASE. It splits words based on transitions between alphanumeric and non-alphanumeric characters, as well as transitions between lowercase and uppercase characters. Example: "ThisIsATest" -> "THIS_IS_A_TEST"
func ToKebabCase ¶
ToKebabCase converts a given string to kebab-case. It splits words based on transitions between alphanumeric and non-alphanumeric characters, as well as transitions between lowercase and uppercase characters. Example: "ThisIsATest" -> "this-is-a-test"
func ToMixedCase ¶
ToMixedCase converts a given string to mixedCase, handling initialisms correctly. Example: "thisIsATest" -> "thisIsATest"
func ToSnakeCase ¶
ToSnakeCase converts a given string to snake_case. It splits words based on transitions between alphanumeric and non-alphanumeric characters, as well as transitions between lowercase and uppercase characters. Example: "ThisIsATest" -> "this_is_a_test"
Types ¶
This section is empty.