stringIgnoreCase function

  1. @useResult
Parser<String> stringIgnoreCase(
  1. String element, [
  2. String? message
])

Returns a parser that accepts the string element ignoring the case.

For example, stringIgnoreCase('foo') succeeds and consumes the input string 'Foo' or 'FOO'. Fails for any other input.

Implementation

@useResult
Parser<String> stringIgnoreCase(String element, [String? message]) => predicate(
    element.length,
    (value) => equalsIgnoreAsciiCase(element, value),
    message ?? '"$element" (case-insensitive) expected');