Removes leading whitespace or specified characters from a string.
The string from which leading characters will be trimmed.
Optional
The character(s) to remove from the start of the string.
const trimmedStr1 = trimStart('---hello', '-') // returns 'hello'const trimmedStr2 = trimStart('000123', '0') // returns '123'const trimmedStr3 = trimStart('abcabcabc', 'a') // returns 'bcabcabc'const trimmedStr4 = trimStart('xxxtrimmed', 'x') // returns 'trimmed' Copy
const trimmedStr1 = trimStart('---hello', '-') // returns 'hello'const trimmedStr2 = trimStart('000123', '0') // returns '123'const trimmedStr3 = trimStart('abcabcabc', 'a') // returns 'bcabcabc'const trimmedStr4 = trimStart('xxxtrimmed', 'x') // returns 'trimmed'
Alias