https://github.com/mtibben/gocase
Gocase converts strings between different casing schemes
https://github.com/mtibben/gocase
Last synced: 24 days ago
JSON representation
Gocase converts strings between different casing schemes
- Host: GitHub
- URL: https://github.com/mtibben/gocase
- Owner: mtibben
- Created: 2014-02-06T05:17:49.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2024-01-02T02:06:41.000Z (over 2 years ago)
- Last Synced: 2024-06-21T20:02:20.324Z (almost 2 years ago)
- Language: Go
- Size: 2.93 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Gocase
[](https://travis-ci.org/mtibben/gocase)
Gocase converts strings between different casing schemes.
- Snake: `may_the_force_be_with_you`
- Upper Snake: `MAY_THE_FORCE_BE_WITH_YOU`
- Spinal: `may-the-force-be-with-you`
- Train: `May-The-Force-Be-With-You`
- Camel: `MayTheForceBeWithYou`
- Lower Camel: `mayTheForceBeWithYou`
For example:
```go
import "github.com/mtibben/gocase"
gocase.ToSnake("May the force be with you") // may_the_force_be_with_you
gocase.ToUpperSnake("May the force be with you") // MAY_THE_FORCE_BE_WITH_YOU
gocase.ToSpinal("May the force be with you") // may-the-force-be-with-you
gocase.ToTrain("May the force be with you") // May-The-Force-Be-With-You
gocase.ToCamel("May the force be with you") // MayTheForceBeWithYou
gocase.ToLowerCamel("May the force be with you") // mayTheForceBeWithYou
```
See https://pkg.go.dev/github.com/mtibben/gocase for documentation.