> 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/split.md).

# \_.split（拆分字符串为数组）

**语法：**

```javascript
_.split([string=''], separator, [limit])
```

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

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

**描述：**

根据`separator`拆分字符串`string`。

> **注意:**&#x8FD9;个方法基于[`String#split`](https://mdn.io/String/split)。

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

**参数：**

* `[string=''] (string)`: 要拆分的字符串。
* `separator (RegExp|string)`: 拆分的分隔符。

  \[limit] (number): 限制结果的数量。&#x20;

**返回值：**

* `(Array)`: 返回拆分部分的字符串的数组。

**例子：**

```javascript
_.split('a-b-c', '-', 2);
// => ['a', 'b']
```
