Skip to main content
String manipulation helpers modify and transform text content.

trim

Removes whitespace from both ends of a string.
Output: hello world

truncate

Shortens text to a specified length with optional suffix.
Examples:
Output: This is a very long descriptio...

substring

Extracts a portion of a string.
Examples:
Output: Hello
Output: World

replace

Replaces all occurrences of a string with another.
Examples:
Output: Hello Universe

repeat

Repeats a string a specified number of times.
Examples:
Output: *****

padStart

Pads the beginning of a string to reach a specified length.
Examples:
Output: 000042

padEnd

Pads the end of a string to reach a specified length.
Examples:
Output: Price...............$99.00

reverse

Reverses the characters in a string.
Output: olleh

removeSpaces

Removes all whitespace from a string.
Output: helloworldexample Use cases:
  • Phone numbers
  • Credit card numbers (for processing)
  • Compact identifiers

Practical Examples

Invoice Number Formatting

Description Preview

Clean Phone Display

Text Separator