1
π‘οΈ Null-Safety (String?)
Returns the original string if it is not
null and not empty, otherwise returns the provided defaultValue. Guarantees a non-null, non-empty result.2
π Security & Encoding
Masks the central portion of the string while keeping a fixed number of characters visible at the beginning and end. Essential for sensitive data.
URL-encodes the string, replacing illegal or unsafe characters (e.g., spaces) with percent-encoded equivalents.3
π Boundaries & Wrapping
Ensures that the string ends with the specified
suffix. The suffix is appended only if the string is not empty and does not already end with it.Ensures that the string starts with the specified
prefix. The prefix is prepended only if the string is not empty and does not already start with it.Wraps the string with the specified left and right delimiters.
Prepends a
# symbol and removes all spaces, formatting the string into a standardized hashtag.Appends a graphical emoji representation to the end of the string, separated by a space.
4
π― Display & Utility
Converts a numeric string into its ordinal form (e.g., β1stβ, β2ndβ, β23rdβ). Requires
isDigitsOnly() to be available.Truncates the string if its length exceeds
maxLength and appends an ellipsis (ββ¦β).Truncates a full name (first and last name) to show the first name and the initial of the last name (e.g., βJohn D.β).
Reverses the order of the characters in the string.
Retrieves the
last N characters of the string.