Jump to content

Split a character string based on change of character: Difference between revisions

m
(→‎JavaScript ES6: Added a variant expressed in terms of a general `span` function.)
Line 1,454:
const i = xs.findIndex(x => !p(x));
 
return -1 !== i ? ([
[xs.slice(0, i),
xs.slice(i)
] : [xs, []];
) : [xs, []];
};
 
9,659

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.