string function
Returns a parser that accepts the string.
messagedefines a custom error message.- If
ignoreCaseistrue, the string is matched in a case-insensitive manner.
For example, string('foo') succeeds and consumes the input string
'foo'. Fails for any other input.
Implementation
@useResult
Parser<String> string(
String string, {
String? message,
bool ignoreCase = false,
}) => ignoreCase
? StringIgnoreCaseParser(
string,
message ?? '"$string" (case-insensitive) expected',
)
: StringParser(string, message ?? '"$string" expected');