trim
Removes whitespace from both ends of a string.hello world
truncate
Shortens text to a specified length with optional suffix.| Argument | Type | Default | Description |
|---|---|---|---|
text | string | required | Text to truncate |
length | number | 100 | Maximum length |
suffix | string | ”…” | Suffix when truncated |
This is a very long descriptio...
substring
Extracts a portion of a string.| Argument | Type | Default | Description |
|---|---|---|---|
text | string | required | Source text |
start | number | 0 | Start index |
end | number | end of string | End index |
Hello
World
replace
Replaces all occurrences of a string with another.| Argument | Type | Description |
|---|---|---|
text | string | Source text |
find | string | String to find |
replace | string | Replacement string |
Hello Universe
repeat
Repeats a string a specified number of times.| Argument | Type | Default | Description |
|---|---|---|---|
text | string | required | Text to repeat |
times | number | 1 | Number of repetitions |
*****
padStart
Pads the beginning of a string to reach a specified length.| Argument | Type | Default | Description |
|---|---|---|---|
text | string | required | Text to pad |
length | number | 2 | Target length |
padString | string | ” “ | Padding character |
000042
padEnd
Pads the end of a string to reach a specified length.| Argument | Type | Default | Description |
|---|---|---|---|
text | string | required | Text to pad |
length | number | 2 | Target length |
padString | string | ” “ | Padding character |
Price...............$99.00
reverse
Reverses the characters in a string.olleh
removeSpaces
Removes all whitespace from a string.helloworldexample
Use cases:
- Phone numbers
- Credit card numbers (for processing)
- Compact identifiers

