strings API Reference
Go strings package — functions for manipulating UTF-8 strings.
strings
Package strings implements simple functions to manipulate UTF-8 encoded strings.
strings.Contains(s, substr string) boolReturn true if substr is within s.
Returns: bool
strings.HasPrefix(s, prefix string) boolReturn true if s begins with prefix.
Returns: bool
strings.HasSuffix(s, suffix string) boolReturn true if s ends with suffix.
Returns: bool
strings.Index(s, substr string) intReturn the index of the first instance of substr in s, or -1 if not present.
Returns: int
strings.Split(s, sep string) []stringSplit s into substrings separated by sep. Returns []string.
Returns: []string
strings.Join(elems []string, sep string) stringConcatenate the elements of elems with sep between each.
Returns: string
strings.Replace(s, old, new string, n int) stringReturn s with the first n non-overlapping instances of old replaced by new. n < 0 means no limit.
Returns: string
strings.ToUpper(s string) stringReturn s with all Unicode letters mapped to upper case.
Returns: string
strings.ToLower(s string) stringReturn s with all Unicode letters mapped to lower case.
Returns: string
strings.Trim(s, cutset string) stringReturn s with all leading and trailing characters in cutset removed.
Returns: string