am 8e643e32: am b76ce125: Merge "Remove a useless function"
* commit '8e643e32e6f07a218323d9a67091c3beed2f88a2': Remove a useless functionmain
commit
203af810b1
|
@ -282,15 +282,4 @@ public final class StringUtils {
|
|||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
public static boolean containsAny(final String string, final String separators) {
|
||||
final int len = separators.length();
|
||||
for (int i = 0; i < len; i = separators.offsetByCodePoints(i, 1)) {
|
||||
final int separator = separators.codePointAt(i);
|
||||
if (-1 != string.indexOf(separator)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -215,22 +215,4 @@ public class StringUtilsTests extends AndroidTestCase {
|
|||
checkCapitalize("Lorem!Ipsum (dolor) Sit * Amet", "Lorem!Ipsum (Dolor) Sit * Amet",
|
||||
" \n,.;!?*()&", Locale.ENGLISH);
|
||||
}
|
||||
|
||||
public void testContainsAny() {
|
||||
assertFalse(StringUtils.containsAny("", " "));
|
||||
assertFalse(StringUtils.containsAny("test and retest", ""));
|
||||
assertTrue(StringUtils.containsAny("test and retest", "x3iq o"));
|
||||
assertTrue(StringUtils.containsAny("test and retest", "x3iqo "));
|
||||
assertTrue(StringUtils.containsAny("test and retest", " x3iqo"));
|
||||
assertFalse(StringUtils.containsAny("test and retest", "x3iqo"));
|
||||
assertTrue(StringUtils.containsAny("test and retest", "tse "));
|
||||
assertTrue(StringUtils.containsAny("test and retest.", ".?()"));
|
||||
assertFalse(StringUtils.containsAny("test and retest", ".?()"));
|
||||
// Surrogate pair
|
||||
assertTrue(StringUtils.containsAny("test and \uD861\uDED7 retest.", "\uD861\uDED7"));
|
||||
// Ill-formed string
|
||||
assertFalse(StringUtils.containsAny("test and \uD861 retest.", "\uD861\uDED7"));
|
||||
// Ill-formed string
|
||||
assertFalse(StringUtils.containsAny("test and \uDED7 retest.", "\uD861\uDED7"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue