_.split([string=''], separator, [limit])
Splits string
by separator
.Note: This method is based on String#split
.
Since
4.0.0
Arguments
[string='']
(string): The string to split.separator
(RegExp|string): The separator pattern to split by.[limit]
(number): The length to truncate results to.
Returns
(Array): Returns the string segments.
Example
_.split('a-b-c', '-', 2);// => ['a', 'b']
当前内容版权归 lodash.com 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 lodash.com .