Package: effect
Module: SchemaGetter
Splits a string into an array of strings by a separator.
When to use
Use when you need a schema getter to split a present encoded string containing a delimited list, such as CSV values.
Details
The getter is pure and never fails. It splits by separator (default ,).
An empty string produces an empty array, not [""].
Example (Splitting a comma-separated string)
import { SchemaGetter } from "effect"
const splitComma = SchemaGetter.split<string>()
// "a,b,c" -> ["a", "b", "c"]
// "" -> []
See
splitKeyValue when values are key-value pairsSignature
declare const split: <E extends string>(options?: { readonly separator?: string | undefined; }) => Getter<ReadonlyArray<string>, E>
Since v4.0.0