You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 1.4 KiB

6 years ago
6 years ago
6 years ago
6 years ago
12345678910111213141516171819202122232425262728293031
  1. # strcase
  2. [![Godoc Reference](https://godoc.org/github.com/iancoleman/strcase?status.svg)](http://godoc.org/github.com/iancoleman/strcase)
  3. [![Build Status](https://travis-ci.org/iancoleman/strcase.svg)](https://travis-ci.org/iancoleman/strcase)
  4. [![Coverage](http://gocover.io/_badge/github.com/iancoleman/strcase?0)](http://gocover.io/github.com/iancoleman/strcase)
  5. [![Go Report Card](https://goreportcard.com/badge/github.com/iancoleman/strcase)](https://goreportcard.com/report/github.com/iancoleman/strcase)
  6. strcase is a go package for converting string case to various cases (e.g. [snake case](https://en.wikipedia.org/wiki/Snake_case) or [camel case](https://en.wikipedia.org/wiki/CamelCase)) to see the full conversion table below.
  7. ## Example
  8. ```go
  9. s := "AnyKind of_string"
  10. ```
  11. | Function | Result |
  12. |-----------------------------------|----------------------|
  13. | `ToSnake(s)` | `any_kind_of_string` |
  14. | `ToScreamingSnake(s)` | `ANY_KIND_OF_STRING` |
  15. | `ToKebab(s)` | `any-kind-of-string` |
  16. | `ToScreamingKebab(s)` | `ANY-KIND-OF-STRING` |
  17. | `ToDelimited(s, '.')` | `any.kind.of.string` |
  18. | `ToScreamingDelimited(s, '.')` | `ANY.KIND.OF.STRING` |
  19. | `ToCamel(s)` | `AnyKindOfString` |
  20. | `ToLowerCamel(s)` | `anyKindOfString` |
  21. ## Install
  22. ```bash
  23. go get -u github.com/iancoleman/strcase
  24. ```