The string to parse
the character that starts the array
the character that ends the array
the character that separates the elements of the array
the flag for deciding to report the number of consumed characters
import std.typecons : Flag, Yes, No; auto s1 = `[['h', 'e', 'l', 'l', 'o'], "world"]`; auto a1 = parse!(string[])(s1); assert(a1 == ["hello", "world"]); auto s2 = `["aaa", "bbb", "ccc"]`; auto a2 = parse!(string[])(s2); assert(a2 == ["aaa", "bbb", "ccc"]); auto s3 = `[['h', 'e', 'l', 'l', 'o'], "world"]`; auto len3 = s3.length; auto a3 = parse!(string[], string, Yes.doCount)(s3); assert(a3.data == ["hello", "world"]); assert(a3.count == len3);
Parses an array from a string given the left bracket (default '['), right bracket (default ']'), and element separator (by default ','). A trailing separator is allowed.