Split a character string based on change of character: Difference between revisions
Split a character string based on change of character (view source)
Revision as of 18:35, 7 March 2022
, 2 years ago→JS ES6
(→JavaScript ES6: Added a variant expressed in terms of a general `span` function.) |
m (→JS ES6) |
||
Line 1,454:
const i = xs.findIndex(x => !p(x));
return -1 !== i ?
] : [xs,
};
|