Example #1
0
 /**
  * Returns true if the current country is a NANPA country and the national number begins with
  * the national prefix.
  */
 private boolean isNanpaNumberWithNationalPrefix()
 {
     // For NANPA numbers beginning with 1[2-9], treat the 1 as the national prefix. The reason is
     // that national significant numbers in NANPA always start with [2-9] after the national prefix.
     // Numbers beginning with 1[01] can only be short/emergency numbers, which don't need the
     // national prefix.
     return((currentMetadata.getCountryCode() == 1) && (nationalNumber.charAt(0) == '1') &&
            (nationalNumber.charAt(1) != '0') && (nationalNumber.charAt(1) != '1'));
 }