Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lawrsp/stringstyles
convert string styles with golang
https://github.com/lawrsp/stringstyles
camel golang kebab snake
Last synced: about 1 month ago
JSON representation
convert string styles with golang
- Host: GitHub
- URL: https://github.com/lawrsp/stringstyles
- Owner: lawrsp
- License: mit
- Created: 2018-09-19T15:54:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-29T15:34:00.000Z (over 4 years ago)
- Last Synced: 2023-08-12T08:15:15.166Z (over 1 year ago)
- Topics: camel, golang, kebab, snake
- Language: Go
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# stringstyles
## install
```bash
go get -u "github/lawrsp/stringstyles"
```## Usage
### CamelCase
```golang
import "github.com/lawrsp/stringstyles"input := "the_quick_brown_fox_jumps_over_the_lazy_dog"
output := stringstyles.CamelCase(input)// got:
// theQuickBrownFoxJumpsOverTheLazyDog
```### SnakeCase
```golang
import "github.com/lawrsp/stringstyles"input := "TheQuickBrownFoxJumpsOverTheLazyDog"
output := stringstyles.SnakeCase(input)// got:
// the_quick_brown_fox_jumps_over_the_lazy_dog
```### KebabCase
```golang
import "github.com/lawrsp/stringstyles"input := "TheQuickBrownFoxJumpsOverTheLazyDog"
output := stringstyles.SnakeCase(input)// got:
// the-quick-brown-fox-jumps-over-the-lazy-dog
```### StudlyCaps
```golang
import "github.com/lawrsp/stringstyles"input := "TheQuickBrownFoxJumpsOverTheLazyDog"
random := 31283726224234348
output := stringstyles.StudlyCaps(input, random)// got:
// ThEquICkbROwNFoXJumPSOVErTHElazyDOg
```