Static
capitalizeCapitalizes the first character of the string.
The string to capitalize.
The string with its first character in uppercase.
Static
charReturns the Unicode code point of the first character of the string.
The input string.
The character code of the first character.
Static
countCounts the number of times a substring occurs in a string.
The input string.
The substring to count.
The count of occurrences.
Static
leftReturns the leftmost n characters of a string.
The input string.
The number of characters.
The substring containing the first n characters.
Static
padPads the left side of a string with a given character up to the specified length.
The input string.
The desired total length.
The padding character (default: space).
The padded string.
Static
padPads the right side of a string with a given character up to the specified length.
The input string.
The desired total length.
The padding character (default: space).
The padded string.
Static
removeRemoves all instances of a substring from a string.
The input string.
The substring to remove.
The string with all instances of subStr removed.
Static
removeRemoves all digit characters from a string.
The input string.
The string with digits removed.
Static
removeRemoves all letter characters from a string.
The input string.
The string with letters removed.
Static
removeRemoves all non-alphanumeric characters from a string.
The input string.
The string with non-alphanumeric characters removed.
Static
removeRemoves all whitespace characters from a string.
The string to process.
The string without any whitespace.
Static
repeatRepeats the input string a specified number of times.
The string to repeat.
The number of times to repeat.
The concatenated result string.
Static
reverseReverses the characters in a string.
The input string.
The reversed string.
Static
rightReturns the rightmost n characters of a string.
The input string.
The number of characters.
The substring containing the last n characters.
Static
splitSplits a string by a delimiter or regular expression.
The string to split.
The delimiter string or RegExp.
Optional
limit: numberOptional maximum number of splits.
An array of split substrings.
Static
toConverts a string to camelCase.
The input string.
The camelCase version of the input.
Static
toConverts a string or number to an integer (using base 10).
The string or number to convert.
The integer value.
Static
toConverts a string to kebab-case.
The input string.
The kebab-case version of the input.
Static
toConverts all characters in a string to lowercase.
The string to convert.
The lowercase version of the input string.
Static
toConverts a string to a floating-point number, returning a fallback if conversion fails.
The string to convert.
The fallback value if conversion fails (default: 0).
The converted number or the fallback.
Static
toConverts a string to PascalCase.
The input string.
The PascalCase version of the input.
Static
toConverts a string to snake_case.
The input string.
The snake_case version of the input.
Static
toConverts all characters in a string to uppercase.
The string to convert.
The uppercase version of the input string.
Static
trimRemoves whitespace from both ends of a string.
The string to trim.
The trimmed string.
Static
truncateTruncates a string to a maximum length.
The input string.
The maximum allowed length.
The truncated string, or the original if shorter than maxLength.
A static utility class for common and advanced string transformation and manipulation tasks.