# 替换掉隐藏字符
vCodeForRedis.replaceAll("\\p{C}", "");
vCode.replaceAll("\\p{C}", "");
# 可以查看隐藏的字符长度;
char[] vCodeForRedisArray = vCodeForRedis.toCharArray();
char[] vCodeArray = vCode.toCharArray();
for (int i = 0; i < vCodeForRedisArray.length; i++) {
System.out.print("["+vCodeForRedisArray[i]+"]");
}
for (int i = 0; i < vCodeArray.length; i++) {
System.out.print("["+vCodeArray[i]+"]");
}
网友评论