String code="11|1|1|02|1|05|09";
//检查重复
String code_t0 = code.replace("\\s","");
if(Pattern.matches("(\\d{2}){1,10}",code_t0)){
throw new RuntimeException("有重复");
}else{
System.out.println("验证通过!");
}
//检查重复
String code_t0 = code.replace("\\s","");
if(Pattern.matches("(\\d{2}){1,10}",code_t0)){
throw new RuntimeException("有重复");
}else{
System.out.println("验证通过!");
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货