Text
Manipulate strings — trim whitespace, change case, split, join, slugify, and more.
Text
| Modifier | Description |
|---|---|
concat | Concat appends one or more strings to the value. |
join | Join combines an array of strings into a single string with a separator. |
lines | Lines splits a string or byte slice into an array of lines. |
lower | ToLower converts a string to lowercase. |
replace | Replace replaces all occurrences of a substring within the string value. |
replace_pattern | ReplacePattern replaces all regex matches within the string value. |
reverse | Reverse reverses the characters in a string. |
sexy | Sexy returns a bear ASCII art. |
shorten | Shorten truncates a string to the given maximum character length. |
slug | Slug converts a string to a URL-friendly slug. |
split | Split splits a string into an array using a separator. |
title | Title converts a hyphen-separated slug into a title-cased string. |
title_model | ModelTitle formats an AI model identifier into a human-readable title. |
trim | Trim removes leading and trailing whitespace, or the given character set. |
trim-prefix | TrimPrefix removes a leading prefix string or leading whitespace from the value. |
trim-suffix | TrimSuffix removes a trailing suffix string or trailing whitespace from the value. |
upper | ToUpper converts a string to uppercase. |
How is this guide?