1
π‘οΈ Null-Safety (String?)
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
3
π Boundaries & Wrapping
String
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.String
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.String
Wraps the string with the specified left and right delimiters.
String
Prepends a
# symbol and removes all spaces, formatting the string into a standardized hashtag.String
Appends a graphical emoji representation to the end of the string, separated by a space.
4
π― Display & Utility
String
Converts a numeric string into its ordinal form (e.g., β1stβ, β2ndβ, β23rdβ). Requires
isDigitsOnly() to be available.String
Truncates the string if its length exceeds
maxLength and appends an ellipsis (ββ¦β).String
Truncates a full name (first and last name) to show the first name and the initial of the last name (e.g., βJohn D.β).
String
Reverses the order of the characters in the string.
String
Retrieves the
last N characters of the string.