Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
Ian Coleman 692d1b89fe Fix ToLowerCamel with leading space il y a 3 ans
.travis.yml Update travisci il y a 4 ans
LICENSE Added license notices of Ian Coleman to each file il y a 5 ans
README.md Update examples in readme il y a 4 ans
acronyms.go Performance optimizations il y a 3 ans
camel.go Fix ToLowerCamel with leading space il y a 3 ans
camel_test.go Fix ToLowerCamel with leading space il y a 3 ans
doc.go refactored doc to please golint il y a 5 ans
snake.go Remove problematic numbers regexp il y a 3 ans
snake_test.go Fix ToLowerCamel with leading space il y a 3 ans

README.md

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