StringUtils extension

on

Methods

capitalizeFirst() String

Available on String, provided by the StringUtils extension

Capitalizes only the first letter of the string.
charCount() int

Available on String, provided by the StringUtils extension

Returns the total number of characters in the string.
charCountWithoutSpaces() int

Available on String, provided by the StringUtils extension

Returns the number of non-whitespace characters in the string.
initials() String

Available on String, provided by the StringUtils extension

Extracts initials from a full name.
isNullOrEmpty() bool

Available on String, provided by the StringUtils extension

Check if a string is either null or empty.
isNumeric() bool

Available on String, provided by the StringUtils extension

Check if the string represents a number.
isPalindrome() bool

Available on String, provided by the StringUtils extension

Check if a string reads the same forward and backward.
isValidEmail() bool

Available on String, provided by the StringUtils extension

Validates if the string is a properly formatted email address
lowerCaseCount() int

Available on String, provided by the StringUtils extension

Returns the number of lowercase characters in the string.
mask({int start = 0, int end = -1, String maskChar = '*'}) String

Available on String, provided by the StringUtils extension

Mask part of the string (e.g., hiding email or phone digits).
onlyDigits() String

Available on String, provided by the StringUtils extension

Extract only digits from the string.
removeDigits() String

Available on String, provided by the StringUtils extension

Removes all digits from the string.
removeSpecialChars() String

Available on String, provided by the StringUtils extension

Removes symbols and keeps only letters and numbers.
removeWhiteSpace() String

Available on String, provided by the StringUtils extension

Removes all white space characters from the string
reverse() String

Available on String, provided by the StringUtils extension

Reverses the string
toCamelCase() String

Available on String, provided by the StringUtils extension

Convert space-separated or snake_case to camelCase.
toggleCase() String

Available on String, provided by the StringUtils extension

Toggles the case of each character in the string.
toSlug() String

Available on String, provided by the StringUtils extension

Converts a string to URL slug format: Example: 'My Blog Post!' → 'my-blog-post'
toTitleCase() String

Available on String, provided by the StringUtils extension

Converts each word in the string to Title Case
truncateWithEllipsis(int maxLength) String

Available on String, provided by the StringUtils extension

Trim string and add ... if it's too long.
upperCaseCount() int

Available on String, provided by the StringUtils extension

Returns the number of uppercase characters in the string.
wordCount() int

Available on String, provided by the StringUtils extension

Counts the number of words in a string.