Split: S extends ""
    ? []
    : S extends `${infer C}${infer R}` ? [C, ...Split<R>] : never

Splits a string into an array of characters.

Type Parameters

  • S extends string

    The string to split.

type Original = Split<"abc">; // ["a", "b", "c"]