# StringToArray

`type` in `services` · v0.7.1

<https://docs.seedcord.org/packages/services/0.7.1/types/string-to-array>

Returns an array of the characters of the string.

## Examples

```ts
type A = StringToArray<'abcde'>;
//=> ['a', 'b', 'c', 'd', 'e']

type B = StringToArray<string>;
//=> never

 String
```

## Declaration

```ts
type StringToArray<
    S extends string,
    Result extends string[] = []
> = string extends S
    ? never
    : S extends `${infer F}${infer R}`
      ? StringToArray<R, [...Result, F]>
      : Result;
```
