[LANG-1584] Refine StringUtils.isNumericSpace (#573)

* refine isNumericSpace

* fix same issues in other two functions
This commit is contained in:
XenoAmess 2020-12-06 01:24:22 +08:00 committed by GitHub
parent 902a0faab4
commit ea8428ab75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -3398,7 +3398,8 @@ public class StringUtils {
}
final int sz = cs.length();
for (int i = 0; i < sz; i++) {
if (!Character.isLetterOrDigit(cs.charAt(i)) && cs.charAt(i) != ' ') {
final char nowChar = cs.charAt(i);
if (nowChar != ' ' && !Character.isLetterOrDigit(nowChar) ) {
return false;
}
}
@ -3433,7 +3434,8 @@ public class StringUtils {
}
final int sz = cs.length();
for (int i = 0; i < sz; i++) {
if (!Character.isLetter(cs.charAt(i)) && cs.charAt(i) != ' ') {
final char nowChar = cs.charAt(i);
if (nowChar != ' ' && !Character.isLetter(nowChar)) {
return false;
}
}
@ -3810,7 +3812,8 @@ public class StringUtils {
}
final int sz = cs.length();
for (int i = 0; i < sz; i++) {
if (!Character.isDigit(cs.charAt(i)) && cs.charAt(i) != ' ') {
final char nowChar = cs.charAt(i);
if (nowChar != ' ' && !Character.isDigit(nowChar)) {
return false;
}
}