package strcase
import "github.com/iancoleman/strcase"
Package strcase converts strings to various cases. See the conversion table below:
| Function | Result | |---------------------------------|--------------------| | ToSnake(s) | any_kind_of_string | | ToScreamingSnake(s) | ANY_KIND_OF_STRING | | ToKebab(s) | any-kind-of-string | | ToScreamingKebab(s) | ANY-KIND-OF-STRING | | ToDelimited(s, '.') | any.kind.of.string | | ToScreamingDelimited(s, '.') | ANY.KIND.OF.STRING | | ToCamel(s) | AnyKindOfString | | ToLowerCamel(s) | anyKindOfString |
Index ¶
- func ConfigureAcronym(key, val string)
- func ToCamel(s string) string
- func ToDelimited(s string, delimiter uint8) string
- func ToKebab(s string) string
- func ToLowerCamel(s string) string
- func ToScreamingDelimited(s string, delimiter uint8, ignore uint8, screaming bool) string
- func ToScreamingKebab(s string) string
- func ToScreamingSnake(s string) string
- func ToSnake(s string) string
- func ToSnakeWithIgnore(s string, ignore uint8) string
Functions ¶
func ConfigureAcronym ¶
func ConfigureAcronym(key, val string)
ConfigureAcronym allows you to add additional words which will be considered acronyms
func ToCamel ¶
ToCamel converts a string to CamelCase
func ToDelimited ¶
ToDelimited converts a string to delimited.snake.case (in this case `delimiter = '.'`)
func ToKebab ¶
ToKebab converts a string to kebab-case
func ToLowerCamel ¶
ToLowerCamel converts a string to lowerCamelCase
func ToScreamingDelimited ¶
ToScreamingDelimited converts a string to SCREAMING.DELIMITED.SNAKE.CASE (in this case `delimiter = '.'; screaming = true`) or delimited.snake.case (in this case `delimiter = '.'; screaming = false`)
func ToScreamingKebab ¶
ToScreamingKebab converts a string to SCREAMING-KEBAB-CASE
func ToScreamingSnake ¶
ToScreamingSnake converts a string to SCREAMING_SNAKE_CASE
func ToSnake ¶
ToSnake converts a string to snake_case
func ToSnakeWithIgnore ¶
Source Files ¶
acronyms.go camel.go doc.go snake.go
- Version
- v0.1.3
- Published
- Nov 22, 2020
- Platform
- js/wasm
- Imports
- 1 packages
- Last checked
- now –
Tools for package owners.