List of utility methods to do String Starts Wtih
boolean | startsWith(StringBuilder sb, String prefix) Tests if this string starts with the specified prefix. return startsWith(sb, prefix, 0);
|
boolean | startsWith(T[] arr, T[] prefix) Tests if the array starts with another prefix array. if (arr.length < prefix.length) return false; for (int i = 0; i < prefix.length; i++) { if (!arr[i].equals(prefix[i])) return false; return true; |
boolean | startsWith4(String string, int startIndex, int char1, int char2, int char3, int char4) Return true if the four-character substring occurs at the given index in the given string. return string.length() - startIndex >= 4 && string.charAt(startIndex) == char1 && string.charAt(startIndex + 1) == char2 && string.charAt(startIndex + 2) == char3 && string.charAt(startIndex + 3) == char4; |
boolean | startsWithAcronym(String word) starts With Acronym return word.length() >= 2 && Character.isUpperCase(word.charAt(0)) && Character.isUpperCase(word.charAt(1))
&& word.matches(ALPHANUMERIC_REGEX);
|
boolean | startsWithAndHasMore(String input, String toStartWith) Returns true iff input String#startsWith(String) starts with toStartWith and has more characters after that match
return input.startsWith(toStartWith) && input.length() > toStartWith.length();
|
boolean | startsWithAny(String _str, String... _startStrings) Checks if given String starts with any of the other given parameters. if (_str == null || _startStrings == null || _startStrings.length == 0) { return false; for (String start : _startStrings) { if (_str.startsWith(start)) { return true; return false; |
boolean | startsWithAny(String s, String... options) Checks whether the given String starts with any of the given options. return indexOfStartsWithAny(s, options) != -1;
|
boolean | startsWithAny(String source, String[] checks) Returns true if source contains any of the Strings held in checks. for (String s : checks) { if (source.toLowerCase().startsWith(s.toLowerCase())) return true; return false; |
boolean | startsWithAny(String str, String... args) starts With Any if (str != null) { for (String s : args) { if (str.startsWith(s)) { return true; return false; ... |
boolean | startsWithAny(String stringToMatch, String... stringToCheckEquals) starts With Any for (final String candidate : stringToCheckEquals) { if (stringToMatch.startsWith(candidate)) { return true; return false; |