MCPcopy Index your code
hub / github.com/Tencent/APIJSON / isIDCard

Method isIDCard

APIJSONORM/src/main/java/apijson/StringUtil.java:648–664  ·  view source on GitHub ↗

判断字符类型是否是身份证号 @param number @return

(String number)

Source from the content-addressed store, hash-verified

646 * @return
647 */
648 public static boolean isIDCard(String number) {
649 if (isCombineOfNumOrAlpha(number) == false) {
650 return false;
651 }
652 number = get(number);
653 if (number.length() == 15) {
654 Log.i(TAG, "isIDCard number.length() == 15 old IDCard");
655 current = number;
656 return true;
657 }
658 if (number.length() == 18) {
659 current = number;
660 return true;
661 }
662
663 return false;
664 }
665
666 public static final String HTTP = "http";
667 public static final String URL_PREFIX = "http://";

Callers

nothing calls this directly

Calls 4

isCombineOfNumOrAlphaMethod · 0.95
getMethod · 0.95
iMethod · 0.95
lengthMethod · 0.45

Tested by

no test coverage detected