https://github.com/julles/go-stringer
String Manipulation for GoLang
https://github.com/julles/go-stringer
go gostringer indonesia package stringer
Last synced: 5 months ago
JSON representation
String Manipulation for GoLang
- Host: GitHub
- URL: https://github.com/julles/go-stringer
- Owner: julles
- Created: 2019-03-04T15:08:36.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-04T16:56:49.000Z (over 7 years ago)
- Last Synced: 2024-12-30T21:25:55.561Z (over 1 year ago)
- Topics: go, gostringer, indonesia, package, stringer
- Language: Go
- Size: 4.88 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Stringer for GoLang
Go Stringer is GoLang package for string manipulation with an expresive syntax.
## How to Install ?
``` sh
go get github.com/julles/go-stringer
```
### Or if you using DEP
``` sh
dep ensure -add github.com/julles/go-stringer
dep ensure
```
# Example
### Basic
Import package
``` go
import (
..
s "github.com/julles/go-stringer"
)
```
Here is the basic usage
``` go
var kata s.Words = "REZA"
kata.LowerFirst()
fmt.Println(kata) // the output "rEZA"
var kata2 s.Words = "REZA"
kata2.Reverse().
Replace("A","I")
fmt.Println(kata2) // the output "IZER"
var kata3 s.Words = "Muhamad Reza Abdul Rohim"
kata3.CamelCase(" ")
fmt.Println(kata3) // the output "muhamadRezaAbdulRohim"
```
Using chaining method
``` go
var kata s.Words = "REZA"
kata.LowerFirst().
LowerLast().
Reverse().
Replace("a", "i").
Repeat(2)
fmt.Println(kata) // the output "iZEriZEr"
```
## Available Methods
| Methods |
|----------|
| .CamelCase(separator string) |
| .Lower() |
| .LowerFirst() |
| .LowerLast() |
| .Repeat(count int) |
| .Replace(search string,replace string) |
| .Reverse() |
| .Substring(start int , end int) |
| .Upper() |
| .UpperFirst() |
| .UpperLast() |
## License
https://reza.mit-license.org/