Examples using... "strings"

Recent
This example demonstrates a custom function to process template text. It installs the strings.Title function and uses it to Make Title Text Look Good In Our Template's Output.
Template is the representation of a parsed template. The *parse.Tree field is exported only for use by html/template and should be treated as unexported by all other clients.
Package scanner provides a scanner and tokenizer for UTF-8-encoded text. It takes an io.Reader providing the source, which then can be tokenized through repeated calls to the Scan function. For compatibility with existing tools, the NUL character is not allowed. If the first character in the source ...
Package scanner provides a scanner and tokenizer for UTF-8-encoded text. It takes an io.Reader providing the source, which then can be tokenized through repeated calls to the Scan function. For compatibility with existing tools, the NUL character is not allowed. If the first character in the source ...
Package scanner provides a scanner and tokenizer for UTF-8-encoded text. It takes an io.Reader providing the source, which then can be tokenized through repeated calls to the Scan function. For compatibility with existing tools, the NUL character is not allowed. If the first character in the source ...
Package scanner provides a scanner and tokenizer for UTF-8-encoded text. It takes an io.Reader providing the source, which then can be tokenized through repeated calls to the Scan function. For compatibility with existing tools, the NUL character is not allowed. If the first character in the source ...
TrimSuffix returns s without the provided trailing suffix string. If s doesn't end with suffix, s is returned unchanged.
TrimSpace returns a slice of the string s, with all leading and trailing white space removed, as defined by Unicode.
TrimRightFunc returns a slice of the string s with all trailing Unicode code points c satisfying f(c) removed.
TrimRight returns a slice of the string s, with all trailing Unicode code points contained in cutset removed.
TrimPrefix returns s without the provided leading prefix string. If s doesn't start with prefix, s is returned unchanged.
TrimLeftFunc returns a slice of the string s with all leading Unicode code points c satisfying f(c) removed.
TrimLeft returns a slice of the string s with all leading Unicode code points contained in cutset removed.
TrimFunc returns a slice of the string s with all leading and trailing Unicode code points c satisfying f(c) removed.
Trim returns a slice of the string s with all leading and trailing Unicode code points contained in cutset removed.
ToUpperSpecial returns a copy of the string s with all Unicode letters mapped to their upper case using the case mapping specified by c.
ToUpper returns s with all Unicode letters mapped to their upper case.
ToTitleSpecial returns a copy of the string s with all Unicode letters mapped to their Unicode title case, giving priority to the special casing rules.
ToTitle returns a copy of the string s with all Unicode letters mapped to their Unicode title case.
ToLowerSpecial returns a copy of the string s with all Unicode letters mapped to their lower case using the case mapping specified by c.
ToLower returns s with all Unicode letters mapped to their lower case.
Title returns a copy of the string s with all Unicode letters that begin words mapped to their Unicode title case.
SplitN slices s into substrings separated by sep and returns a slice of the substrings between those separators.
SplitAfterN slices s into substrings after each instance of sep and returns a slice of those substrings.
SplitAfter slices s into all substrings after each instance of sep and returns a slice of those substrings.
Split slices s into all substrings separated by sep and returns a slice of the substrings between those separators.
ReplaceAll returns a copy of the string s with all non-overlapping instances of old replaced by new. If old is empty, it matches at the beginning of the string and after each UTF-8 sequence, yielding up to k+1 replacements for a k-rune string.