Documentation
¶
Overview ¶
Package stringcase makes it so you can convert strings to different casing styles:
* lower case
* UPPER CASE
* Title Case
* camelCase
* PascalCase
* snake_case
* CONST_CASE
* property-case
* Header-Case
Samples
s := stringcase.ToLowerCase("Hello world") // hello world
.
s := stringcase.ToUpperCase("Hello world") // HELLO WORLD
.
s := stringcase.ToTitleCase("Hello world") // Hello World
,
s := stringcase.ToCamelCase("Hello world") // helloWorld
.
s := stringcase.ToPascalCase("Hello world") // HelloWorld
.
s := stringcase.ToSnakeCase("Hello world") // hello_world
.
s := stringcase.ToConstCase("Hello world") // HELLO_WORLD
.
s := stringcase.ToPropertyCase("Hello world") // hello-world
.
s := stringcase.ToHeaderCase("Hello world") // Hello-World
Index ¶
- func ToCamelCase(s string) string
- func ToConstCase(s string) string
- func ToHeaderCase(s string) string
- func ToLowerCase(s string) string
- func ToPascalCase(s string) string
- func ToPropertyCase(s string) string
- func ToSnakeCase(s string) string
- func ToTitleCase(s string) string
- func ToUpperCase(s string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToCamelCase ¶
ToCamelCase converts the string to 'camelCase' and returns it.
func ToConstCase ¶
ToConstCase converts the string to 'CONST_CASE' and returns it.
func ToHeaderCase ¶
ToHeaderCase converts the string to 'Header-Case' and returns it.
func ToLowerCase ¶
ToLowerCase converts the string to 'lower case' and returns it.
func ToPascalCase ¶
ToPascalCase converts the string to 'PascalCase' and returns it.
func ToPropertyCase ¶
ToPropertyCase converts the string to 'property-case' and returns it.
func ToSnakeCase ¶
ToSnakeCase converts the string to 'snake_case' and returns it.
func ToTitleCase ¶
ToTitleCase converts the string to 'Title Case' and returns it.
func ToUpperCase ¶
ToUpperCase converts the string to 'UPPER CASE' and returns it.
Types ¶
This section is empty.