capitalize() | Capitalizes the first letter of each word. | "product name" -> "Product Name" |
trim() | Removes whitespace from both ends of a string. | " product " -> "product" |
toNumber() | Converts a string to a number. | "123.45" -> 123.45 |
toBoolean() | Converts a value to a boolean. | "true" -> true, "1" -> true, "false" -> false, "0" -> false |
toString() | Converts a value to a string. | 123 -> "123" |
removeHTMLTags() | Strips HTML tags from a string. | "<p>Product description</p>" -> "Product description" |
convert(fromUnit, toUnit) | Converts between units. | convert("cm", "in") applied to "100" -> "39.37" |
split(separator, index) | Splits a string and returns the specified index. | split(",", "1") applied to "red,green,blue" -> "green" |
slice(start, end?) | Returns a portion of an array or string. | slice("1", "3") applied to "abcdef" -> "bcd" |
match(regex) | Returns the first match of a regular expression. | match("\\d+") applied to "Product123" -> "123" |
replace(search, replacement) | Replaces all occurrences of a substring. | replace("old", "new") applied to "old product" -> "new product" |
join(separator) | Joins array elements into a string. | join(", ") applied to ["red", "green", "blue"] -> "red, green, blue" |