isAlphanumeric method

bool isAlphanumeric()

Returns true if the the target string contains only letters or digits Note that spaces are counted as alphanumeric

For example:

  • '6+bird'.isAlphanumeric() -> false
  • 'move 21'.isAlphanumeric() -> true
  • 'switch4.1'.isAlphanumeric() -> true

Implementation

bool isAlphanumeric() {
  return alphanumericRegex.hasMatch(this);
}