isIDCard static method

bool isIDCard(
  1. String input
)

Return whether input matches regex of id card number.

Implementation

static bool isIDCard(String input) {
  if (input.length == 15) {
    return isIDCard15(input);
  }
  if (input.length == 18) {
    return isIDCard18Exact(input);
  }
  return false;
}