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

使用正则表达式:

 

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

 

posted @ 2018-05-22 21:10  东风知我欲山行  阅读(107)  评论(0编辑  收藏  举报