A Golang string manipulation library. Inspired by https://github.com/dleitee/strman
Get sting
go get github.com/younisshah/sting
Append("f", "o", "o") // => "foo"
AppendArray("f", []string{"o", "o", "b", "a", "r"}) // => "foobar"
At("foobar", 1) // => "o"
Chars("foobar") // => ["f", "o", "o", "b", "a", "r"]
Chars("foo bar") // => "foo bar"
ContainsAll - Checks whether the haystack contains all the needles with inline whitespaces taken care of.
ContainsAll("foo bar baz", []string{"foo", "baz", "bar"}) // => true
EndsWith("foo bar", "BAR") // => true
Base64Encode("sting") // => "c3Rpbmc="
Base64Decode("c3Rpbmc=") // => "sting"
First("foobar", 3) // => "foo"
Head("foobar") // => "f"
NOTE: indexing/counting starts at 0
Insert("foobarqooz", "baz", 5) // => "foobarbazqooz"
LeftPad("1", "0", 5) // => "00001"
RightPad("1", "0", 5) // => "10000"
Reverse("gnits") // => "sting"
CamelCase("CamelCase") // => "camelCase"
KebabCase("kebab Case") // => "kebab-case"
SnakeCase("snake Case") // => "snake_case"
Transliterate("stἵnĝ") // => "sting"