Date

“String” Methods

_.trimStart([string=''], [chars=whitespace])

source npm package

Removes leading whitespace or specified characters from string.

引入版本

4.0.0

参数
[string=''] (string) : The string to trim.
[chars=whitespace] (string) : The characters to trim.

返回值
(string) : Returns the trimmed string.

示例
_.trimStart('  abc  ');
// => 'abc  '
 
_.trimStart('-_-abc-_-', '_-');
// => 'abc-_-'