Go to file
2020-08-26 08:56:07 +10:00
.travis.yml Remove go versions in CI with no strings.Builder 2020-08-26 08:56:07 +10:00
acronyms.go Performance optimizations 2020-08-17 08:49:01 +10:00
camel_test.go Fix ToLowerCamel with leading space 2020-08-26 08:46:32 +10:00
camel.go Fix ToLowerCamel with leading space 2020-08-26 08:46:32 +10:00
doc.go refactored doc to please golint 2019-04-19 09:12:49 +02:00
LICENSE Added license notices of Ian Coleman to each file 2018-07-03 19:52:40 +02:00
README.md Update examples in readme 2019-11-13 10:22:13 +11:00
snake_test.go Fix ToLowerCamel with leading space 2020-08-26 08:46:32 +10:00
snake.go Remove problematic numbers regexp 2020-08-17 08:50:29 +10:00

strcase

Godoc Reference Build Status Coverage Go Report Card

strcase is a go package for converting string case to various cases (e.g. snake case or camel case) to see the full conversion table below.

Example

s := "AnyKind of_string"
Function Result
ToSnake(s) any_kind_of_string
ToSnakeWithIgnore(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, '.', '', true) ANY.KIND.OF.STRING
ToScreamingDelimited(s, '.', ' ', true) ANY.KIND OF.STRING
ToCamel(s) AnyKindOfString
ToLowerCamel(s) anyKindOfString

Install

go get -u github.com/iancoleman/strcase