trimStart es-toolkit
Removes whitespace or specified characters from the start of a string.
Usage
trimStart(str, chars?)
Use trimStart when you want to remove unnecessary characters from the beginning of a string. If no specific characters are specified, it removes whitespace characters.
If you specify multiple characters as an array, all characters matching any of them will be removed.
Parameters
The string to remove characters from the start.
The characters to remove. Can be a string or an array of characters. Defaults to whitespace characters.
Returns
Returns a new string with the specified characters removed from the start.
Errors
Throws an error if chars is a string with a length other than 1.
Source: es-toolkit
Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.