The String extension adds several useful methods to the built-in String type.
Returns a new string with the first character of each word capitalized.
Returns a new string with the first character of each word capitalized, and the rest of the word in lowercase.
Adds spaces to a string based on the specified type.
type: One of'uppercase','-','_', or'/'. Specifies where to add spaces.
Returns a new string with spaces added.
Removes all occurrences of a substring from a string.
substr: The substring to remove.
Returns a new string with the substring removed.
Returns a new string in snake_case format.
Returns a new string in kebab-case format.
Returns a new string with the characters reversed.
Returns a new string with all whitespace characters removed.
Returns a boolean indicating whether the string is a palindrome.
Returns the number of occurrences of a substring in a string.
substr: The substring to count.
Returns a number representing the count.
Truncates a string to a specified length.
length: The length to truncate to.
Returns a new string truncated to the specified length.