Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/twihike/go-strcase
🐫 A string case converter between camel case, snake case and kebab case
https://github.com/twihike/go-strcase
camelcase convert go golang kebabcase snakecase
Last synced: 2 days ago
JSON representation
🐫 A string case converter between camel case, snake case and kebab case
- Host: GitHub
- URL: https://github.com/twihike/go-strcase
- Owner: twihike
- License: mit
- Created: 2020-10-09T14:24:40.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-09-19T13:01:38.000Z (about 3 years ago)
- Last Synced: 2023-07-27T22:43:52.964Z (over 1 year ago)
- Topics: camelcase, convert, go, golang, kebabcase, snakecase
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-strcase
[![ci status](https://github.com/twihike/go-strcase/workflows/ci/badge.svg)](https://github.com/twihike/go-strcase/actions) [![license](https://img.shields.io/github/license/twihike/go-strcase)](LICENSE)
A string case converter between camel case, snake case and kebab case.
## Installation
```shell
go get -u github.com/twihike/go-strcase
```## Usage
```go
package mainimport (
"fmt""github.com/twihike/go-strcase/strcase"
)func main() {
fmt.Println(strcase.ToLowerSnake("fooBar")) // foo_bar
fmt.Println(strcase.ToUpperSnake("fooBar")) // FOO_BAR
fmt.Println(strcase.ToLowerKebab("fooBar")) // foo-bar
fmt.Println(strcase.ToUpperKebab("fooBar")) // FOO-BAR
fmt.Println(strcase.ToLowerCamel("foo_bar")) // fooBar
fmt.Println(strcase.ToUpperCamel("foo_bar")) // FooBar
fmt.Println(strcase.UpperCamelToLowerCamel("FooBar")) // fooBar
fmt.Println(strcase.LowerCamelToUpperCamel("fooBar")) // FooBar
}
```## License
Copyright (c) 2020 twihike. All rights reserved.
This project is licensed under the terms of the MIT license.