Skip to Content
typesSplit

Split

See source on Github

Split a string into an array of substrings using the specified separator and return the result.

Example

type T0 = Split<'a-b-c', '-'>; // ['a', 'b', 'c'] type T1 = Split<'a-b-c', '.'>; // ['a-b-c'] type T2 = Split<'a-b-c', ''>; // ['a', '-', 'b', '-', 'c']