@Test public void testIsAlphanumeric() { Assert.assertTrue(StringUtils.isAlphanumeric("foo123")); Assert.assertFalse(StringUtils.isAlphanumeric("foo_123")); }
public static boolean isAlphanumeric(String str) { for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); if (!Character.isDigit(c) && !Character.isLetter(c)) { return false; } } return true; }
StringUtils { public static boolean isAlphanumeric(String str) { for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); if (!Character.isDigit(c) && !Character.isLetter(c)) { return false; } } return true; } }
StringUtils { public static boolean isAlphanumeric(String str) { for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); if (!Character.isDigit(c) && !Character.isLetter(c)) { return false; } } return true; } private  StringUtils(); }
StringUtils { public static boolean isAlphanumeric(String str) { for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); if (!Character.isDigit(c) && !Character.isLetter(c)) { return false; } } return true; } private  StringUtils(); static boolean isOnlyWhitespace(String str); static boolean isPossiblyJavaClass(String s); static String getReadableTime(long time_ms); static int nthIndexOf(String str, String substr, int n); static boolean startsWithFnameChars(String value); static boolean startsWithURIChars(String value); static int countURIEndingPushback(String value); static boolean isAlphanumeric(String str); static int patindexOf(String value, Pattern pattern); static boolean startsWithFpathChar(String value); static int countPushback(String capture, Pattern pat); static int whitespaceOrControlLength(String str, int off, boolean shouldMatch); }
StringUtils { public static boolean isAlphanumeric(String str) { for (int i = 0; i < str.length(); i++) { char c = str.charAt(i); if (!Character.isDigit(c) && !Character.isLetter(c)) { return false; } } return true; } private  StringUtils(); static boolean isOnlyWhitespace(String str); static boolean isPossiblyJavaClass(String s); static String getReadableTime(long time_ms); static int nthIndexOf(String str, String substr, int n); static boolean startsWithFnameChars(String value); static boolean startsWithURIChars(String value); static int countURIEndingPushback(String value); static boolean isAlphanumeric(String str); static int patindexOf(String value, Pattern pattern); static boolean startsWithFpathChar(String value); static int countPushback(String capture, Pattern pat); static int whitespaceOrControlLength(String str, int off, boolean shouldMatch); static final Pattern STANDARD_EOL; static final Pattern APOS_NO_BSESC; static final Pattern END_C_COMMENT; }