List of utility methods to do String Starts Wtih
boolean | startsWithLetterOrUnderscore(String value) starts With Letter Or Underscore if (isEmpty(value)) { return false; char character = value.charAt(0); return character == '_' || Character.isLetter(character); |
boolean | startsWithLinuxRoot(String path) Checks if the provide path starts with a valid Linux root, that is "/". return path != null && path.startsWith("/"); |
boolean | startsWithLowerCase(String text) starts With Lower Case if (text == null || text.length() == 0 || !Character.isLowerCase(text.charAt(0))) { return false; return true; |
boolean | startsWithLowerCaseChar(String s) Checks if a string starts with lower case char. int c0 = (int) s.charAt(0); return (c0 >= 97 && c0 <= 122) ? true : false; |
boolean | startsWithMultiple(String string, String... starts) Checks if the input string starts with any of the values. for (String start : starts) { if (string.startsWith(start)) { return true; return false; |
boolean | startsWithName(String subject, String beginName) starts With Name if (!subject.startsWith(beginName)) { return false; if (beginName.length() == 0) { return true; if (subject.length() == beginName.length()) { return true; ... |
boolean | startsWithNoCase(String csValue, String csStart) starts With No Case csValue = csValue.toUpperCase();
csStart = csStart.toUpperCase();
return csValue.startsWith(csStart);
|
int | startsWithOne(final String src, final String[] dest) starts With One for (int i = 0; i < dest.length; ++i) { final String m = dest[i]; if (m != null) { if (src.startsWith(m)) { return i; return -1; |
boolean | startsWithOneOf(String source, boolean ignoreCase, String... values) Determine whether the specified source string starts with one of the specified values. if ((source == null) || (values == null)) return false; String s = ignoreCase ? source.toLowerCase() : source; for (String val : values) { if (val == null) continue; String s2 = ignoreCase ? val.toLowerCase() : val; if (s.startsWith(s2)) ... |
boolean | startsWithOneOf(String str, String... strs) starts With One Of for (String t : strs) if (str.startsWith(t)) return true; return false; |