Date

“String” Methods

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

source npm package

Splits string by separator.

Note: This method is based on String#split.

引入版本

4.0.0

参数
[string=''] (string) : The string to split.
separator (RegExp|string) : The separator pattern to split by.
[limit] (number) : The length to truncate results to.

返回值
(Array) : Returns the string segments.

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