[−][src]Module sprig::strings
Functions
abbrev | Truncate a string with ellipses. |
abbrevboth | Abbreviate from both sides, yielding "...lo wo..." |
base32encode | Base 32 encode a string. |
base32decode | Base 32 decode a string. |
base64encode | Base 64 encode a string. |
base64decode | Base 64 decode a string. |
contains | Golang's strings.Contains, but with the arguments switched: |
has_prefix | Golang's strings.hasPrefix, but with the arguments switched |
has_suffix | Golang's strings.hasSuffix, but with the arguments switched |
indent | Indent every line in a given string to the specified indent width. This is useful when aligning multi-line strings. |
initials | Given a multi-word string, return the initials. |
join | Golang's strings.Join, but as |
lower | Golang's strings.ToLower |
nindent | Same as the indent function, but prepends a new line to the beginning of the string. |
nospace | Remove all space characters from a string. nospace "h e l l o" becomes "hello" |
plural | |
rand_alpha | Given a length, generate an alphabetic string |
rand_alpha_numeric | Given a length, generate a random alphanumeric sequence |
rand_ascii | Given a length, generate a random ASCII string (symbols included) |
rand_numeric | Given a length, generate a string of digits. |
repeat | strings.Repeat, but with the arguments switched: repeat count str. (This simplifies common pipelines) |
replace | |
split | Golang's strings.Split, but as |
substring | Given string, start, and length, return a substr. |
trim | Golang's strings.TrimSpace |
trim_all | Golang's strings.Trim, but with the argument order reversed
|
trim_prefix | Golang's strings.TrimPrefix, but with the argument order reversed |
trim_suffix | Golang's strings.TrimSuffix, but with the argument order reversed:
|
trunc | Truncate a string (no suffix). |
untitle | Remove title casing |
upper | Golang's strings.ToUpper |