List of utility methods to do String Starts Wtih
boolean | startsWithAny(String text, String... prefixes) Return whether the non-null text arg starts with any of the prefix values. for (String prefix : prefixes) { if (text.startsWith(prefix)) { return true; return false; |
boolean | startsWithAny(String toMatch, String... startsWithAny) Checks if a given String starts with any of the given Strings for (String s : startsWithAny) { return toMatch.startsWith(s); return false; |
boolean | startsWithAnyCI(String string, String... prefixes) starts With Any CI string = string.toLowerCase(); for (String prefix : prefixes) if (string.startsWith(prefix.toLowerCase())) return true; return false; |
boolean | startsWithAnyCS(String str, String[] needles) starts With Any CS if (str == null || str.length() == 0) return false; for (String n : needles) { if (str.startsWith(n)) return true; return false; |
boolean | startsWithAnyIgnoreCase(String s, String... options) Checks whether the given String starts with any of the given options, ignoring the case if (s == null) { return false; for (String element : options) { if (s.toLowerCase().startsWith(element.toLowerCase())) { return true; return false; |
boolean | startsWithAnyIgnoreCase(String string, String... searchStrings) starts With Any Ignore Case for (int i = 0; i < searchStrings.length; i++) { String searchString = searchStrings[i]; if (startsWithIgnoreCase(string, searchString)) { return true; return false; |
boolean | startsWithAnyOfThose(final String in, final String[] prefixes) starts With Any Of Those for (final String prefix : prefixes) { if (in.startsWith(prefix)) { return true; return false; |
boolean | startsWithAt(String text, String toFind, int offset) starts With At for (int i = 0; i < toFind.length(); i++) { if (offset + i >= text.length() || text.charAt(offset + i) != toFind.charAt(i)) { return false; return true; |
boolean | startsWithCamelCase(String string, String prefix) starts With Camel Case return string.length() > prefix.length() && string.startsWith(prefix)
&& Character.isUpperCase(string.charAt(prefix.length()));
|
boolean | startsWithCapLettersEndsWithDigits(String text) Determine if a string starts with capital letter(s) and ends with digit(s). boolean result = false; if (!isNullOrEmpty(text, true)) { char[] cs = text.toCharArray(); int j = 0; while ((j < cs.length) && (Character.isUpperCase(cs[j]))) { j++; if ((j == 0) || (j == cs.length)) { ... |