- Notifications
You must be signed in to change notification settings - Fork0
Golang pkg to convert any text input to camelCase, PascalCase or snake_case naming convention. Removes all whitespaces and special characters. Supports Unicode characters.
License
golang-cz/textcase
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Golang pkg to convert any text input tocamelCase,PascalCase,snake_case orkebab-case naming convention. Removes all whitespaces and special characters. Supports Unicode characters.
import"github.com/golang-cz/textcase"textcase.CamelCase("Hello World!")// helloWorldtextcase.PascalCase("Hello World!")// HelloWorldtextcase.SnakeCase("Hello World!")// hello_worldtextcase.KebabCase("Hello World!")// hello-world
textcase.CamelCase("Háčky, čárky. Příliš žluťoučký kůň úpěl ďábelské ódy.")// háčkyČárkyPřílišŽluťoučkýKůňÚpělĎábelskéÓdy
textcase.CamelCase("Here comes O'Brian")// hereComesOBrian
This package doesn't implement language-specific case mappers, such asgolang.org/x/text/cases, and thus comes with a similar limitation tostrings.Title(). But given the likely use cases of this package, we deliberately chose English versionhereComesOBrian
overhereComesObrian
for the aboveHere comes O'Brian
input.
Licensed underMIT License
About
Golang pkg to convert any text input to camelCase, PascalCase or snake_case naming convention. Removes all whitespaces and special characters. Supports Unicode characters.