Remove a useless function

Bug: 8583091
Change-Id: I9195d68e44e9a282e25ccd2978d7b4088f600170
main
Jean Chalard 2013-04-15 22:01:37 +09:00
parent 033958330d
commit bc501647fd
2 changed files with 0 additions and 29 deletions

View File

@ -282,15 +282,4 @@ public final class StringUtils {
} }
return builder.toString(); 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;
}
} }

View File

@ -215,22 +215,4 @@ public class StringUtilsTests extends AndroidTestCase {
checkCapitalize("Lorem!Ipsum (dolor) Sit * Amet", "Lorem!Ipsum (Dolor) Sit * Amet", checkCapitalize("Lorem!Ipsum (dolor) Sit * Amet", "Lorem!Ipsum (Dolor) Sit * Amet",
" \n,.;!?*()&", Locale.ENGLISH); " \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"));
}
} }