by ddspog
Package str represents a string production line.
You are free to copy, modify and distribute str package with attribution under the terms of the MIT license. See the LICENSE file for details.
Install str package with:
go get github.com/ddspog/str
This package represents a string production line.
This is made with the interfaces in this package Chainer, Splitter and Collecter. Each are created using srt.New as starting point, this function will convert via fmt.Sprintf, a string to Chainer. And then various operations can be performed on it.
Each object have the ability to put its output as a string, as an error and printed onto desired io.Writer.
The package can be used like this:
feat := "The_fire_Blaze"
s := str.New(feat).Split("_").String() // "ThefireBlaze"
This package is slower than usual solutions. Because it makes lots of conversion, and the use of fmt package itself, that have some performance problems.
This is due to the objective of this package: to be a clearer tool to operates on strings.
This package has tests covering all code on it. Further additions to code should try to follow this.
This package has some objectives from now:
- Incorporate all operations on strings package.
- Incorporate any new ideas about possible improvements.
Any interest in help is much appreciated.