__anonymous.matchUntil

Match all next characters against the function until it returns true

struct __anonymous
TString
matchUntil
(
Checker check
)

Parameters

check
Type: Checker

Function to match against.

Return Value

Type: TString

All matched characters.

Examples

1 auto stream = parsingStream("This is a sentence");
2 
3 assert(stream.skip.matchUntil(ch => ch == ' ') == "This");
4 assert(stream.skip.matchUntil(ch => ch == ' ') == "is");
5 assert(stream.skip.matchUntil(ch => ch == 'n') == "a se");
6 assert(!stream.step(a => a == 't'));
7 

Meta