字符串中是否有相同的字符

使用正则表达式:

public boolean checkDifferent(String iniString) {   
return !iniString.matches(".*(.)(.*\\1).*");
}

猜你喜欢

转载自www.cnblogs.com/wang-130213/p/9074117.html