isCharCode static method

bool isCharCode(
  1. int cc, {
  2. bool digit = false,
  3. bool upper = false,
  4. bool lower = false,
  5. bool whitespace = false,
})

Returns whether the character code matches the specified conditions.

  • cc is the character to test.
  • digit specifies if it matches digit.
  • upper specifies if it matches upper case.
  • lower specifies if it matches lower case.
  • whitespace specifies if it matches whitespace.
  • match specifies a string of characters that are matched (aka., allowed).

Implementation

static bool isCharCode(int cc, {bool digit = false, bool upper = false,
    bool lower = false, bool whitespace = false})
=>   (digit && cc >= $0 && cc <= $9)
  || (upper && cc >= $A && cc <= $Z)
  || (lower && cc >= $a && cc <= $z)
  || (whitespace && $whitespaces.contains(cc));