Fix tabs to spaces, thank you Jörg.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@923386 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
022d08cfd3
commit
6505531d5c
|
@ -1437,32 +1437,32 @@ public class StringUtils {
|
|||
* <code>false</code> if no match or null input
|
||||
* @since 2.4
|
||||
*/
|
||||
public static boolean containsAny(CharSequence cs, char[] searchChars) {
|
||||
if (isEmpty(cs) || ArrayUtils.isEmpty(searchChars)) {
|
||||
return false;
|
||||
}
|
||||
int csLength = cs.length();
|
||||
int searchLength = searchChars.length;
|
||||
int csLastIndex = csLength - 1;
|
||||
int searchLastIndex = searchLength - 1;
|
||||
for (int i = 0; i < csLength; i++) {
|
||||
char ch = cs.charAt(i);
|
||||
for (int j = 0; j < searchLength; j++) {
|
||||
if (searchChars[j] == ch) {
|
||||
if (i < csLastIndex && j < searchLastIndex && ch >= Character.MIN_HIGH_SURROGATE && ch <= Character.MAX_HIGH_SURROGATE) {
|
||||
// ch is a supplementary character
|
||||
if (searchChars[j + 1] == cs.charAt(i + 1)) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
// ch is in the Basic Multilingual Plane
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static boolean containsAny(CharSequence cs, char[] searchChars) {
|
||||
if (isEmpty(cs) || ArrayUtils.isEmpty(searchChars)) {
|
||||
return false;
|
||||
}
|
||||
int csLength = cs.length();
|
||||
int searchLength = searchChars.length;
|
||||
int csLastIndex = csLength - 1;
|
||||
int searchLastIndex = searchLength - 1;
|
||||
for (int i = 0; i < csLength; i++) {
|
||||
char ch = cs.charAt(i);
|
||||
for (int j = 0; j < searchLength; j++) {
|
||||
if (searchChars[j] == ch) {
|
||||
if (i < csLastIndex && j < searchLastIndex && ch >= Character.MIN_HIGH_SURROGATE && ch <= Character.MAX_HIGH_SURROGATE) {
|
||||
// ch is a supplementary character
|
||||
if (searchChars[j + 1] == cs.charAt(i + 1)) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
// ch is in the Basic Multilingual Plane
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
|
Loading…
Reference in New Issue