parse

Parses an array from a string given the left bracket (default '['), right bracket (default ']'), and element separator (by default ','). A trailing separator is allowed.

Parameters

s Source

The string to parse

lbracket dchar

the character that starts the array

rbracket dchar

the character that ends the array

comma dchar

the character that separates the elements of the array

Return Value

Type: Target

An array of type Target

Examples

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"]);

Meta

Suggestion Box / Bug Report