split function
- String separator,
- IValidator child, {
- String? message,
Splits a string into a list of substrings.
Splits the input string at each occurrence of the separator. Fails if the
input value is not a string.
Passes the resulting list of strings to the child validator.
Example: split(',', listEach(toInt(isGte(0))))
Implementation
IValidator split(String separator, IValidator child, {String? message}) {
final base = isString() & core.transform((v) => v.split(separator), child);
return core.handleReturnPreserveValue(base, message);
}