Documentation ¶
Overview ¶
Strings provides high-performance string management and manipulation capabilities.
Index ¶
- func JoinBytes(separator []byte, byteArray ...[]byte) []byte
- func JoinStrings(separator string, stringArray ...string) string
- func JoinStringsReversed(separator string, stringArray ...string) string
- func MergeBytes(byteArray ...[]byte) []byte
- func MergeStrings(stringArray ...string) string
- func MergeStringsReversed(stringArray ...string) string
- func Parse(s string) interface{}
- func SplitBy(s string, decider func(r rune) bool) []string
- func SplitByCamelCase(s string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JoinBytes ¶
JoinStrings joins many []byte strings together separated by the specified separator.
func JoinStrings ¶
JoinStrings joins many strings together separated by the specified separator.
func JoinStringsReversed ¶
JoinStringsReversed joins many strings together backwards separated by the specified separator.
func MergeBytes ¶
MergeBytes merges an array of []byte strings into one []byte.
Example
one := []byte("Hello") two := []byte(" ") three := []byte("Stretchr!") // merge the bytes mergedBytes := strings.MergeBytes(one, two, three) log.Print(mergedBytes) // prints "Hello Stretchr!"
func MergeStrings ¶
MergeStrings merges many strings together.
func MergeStringsReversed ¶
MergeStringsReversed merges many strings together backwards.
func Parse ¶
func Parse(s string) interface{}
Parse tries to create a native object from the given string, or just returns the string if nothing takes.
Values wrapped in "quotes" or 'single quotes' will always be treated as a string, but the quotes will be removed.
This method knows about all number types, and will always look for the smallest type to fit the number. It also handles the boolean literals 'true' and 'false'.
An empty string ("") will return nil.
func SplitByCamelCase ¶
SplitByCamelCase splits the string up by each capital character.
Types ¶
This section is empty.