> For the complete documentation index, see [llms.txt](https://lodash.shujuwajue.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lodash.shujuwajue.com/string/trimstart.md).

# \_.trimStart（移除头部空格或指定字符）

**语法：**

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

**源代码链接：**[source](https://github.com/lodash/lodash/blob/4.17.10/lodash.js#L15017)

**npm包链接：**[npm package](https://www.npmjs.com/package/lodash.trimstart)

**描述：**

移除`string`字符串头部的 空格 或 指定的字符。

**开始版本：**&#x34;.0.0

**参数：**

* `[string=''] (string)`: 要处理的字符串。
* `[chars=whitespace] (string)`: 要移除的字符。

**返回值：**

* `(string)`: 返回处理后的字符串。

**例子：**

```javascript
_.trimStart('  abc  ');
// => 'abc  '

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