JavaScript String trimStart()
Definition and Usage
The trimStart()
method removes whitespace from the beginning of a string.
The trimStart()
method does not change the original string.
The trimStart()
method works like trim()
, but removes whitespace only from the start of a string.
See Also:
The trimStart()
method was added to JavaScript in ECMAScript 2019.
Note
Syntax
string.trimStart()
Parameters
NONE |
Return Value
Type | Description |
A string | A string with removed whitespace from the beginning of the string. |
JavaScript String trimStart()
is supported in all browsers since January 2020:
Chrome 66 | Edge 79 | Firefox 61 | Safari 12 | Opera 50 |
Apr 2018 | Jan 2020 | Jun 2018 | Sep 2018 | May 2018 |