List of utility methods to do String Ends With
boolean | endsWith3(String string, int char1, int char2, int char3) Return true if the three-character substring occurs at the end of the given string. int length = string.length(); return length >= 3 && string.charAt(length - 3) == char1 && string.charAt(length - 2) == char2 && string.charAt(length - 1) == char3; |
boolean | endsWithAny(final byte[] str, int startIndex, int endIndex, final byte... chars) ends With Any if (startIndex < 0) { startIndex = 0; if (endIndex > str.length) { endIndex = str.length; if (startIndex >= endIndex) { return false; ... |
boolean | endsWithAny(String str, String... args) ends With Any if (str != null) { for (String s : args) { if (str.endsWith(s)) return true; return false; |
boolean | endsWithAny(String string, String searchStrings[]) ends With Any if (isEmpty(string) || (searchStrings == null || searchStrings.length < 1)) return false; for (int i = 0; i < searchStrings.length; i++) { String searchString = searchStrings[i]; if (endsWith(string, searchString)) return true; return false; ... |
boolean | endsWithAny(String stringToMatch, String... stringToCheckEquals) ends With Any for (final String candidate : stringToCheckEquals) { if (stringToMatch.endsWith(candidate)) { return true; return false; |
boolean | endsWithAnyCI(String string, String... suffixes) ends With Any CI string = string.toLowerCase(); for (String suffix : suffixes) if (string.endsWith(suffix.toLowerCase())) return true; return false; |
boolean | endsWithAnyIC(String str, String[] needles) ends With Any IC if (str == null || str.length() == 0 || needles == null || needles.length == 0) return false; str = str.toLowerCase(); for (String n : needles) { if (str.endsWith(n)) return true; return false; ... |
boolean | endsWithBackslash(final String s) ends With Backslash return s.endsWith("\\") && s.endsWith("\\\\") == false; |
boolean | endsWithChar(CharSequence s, char suffix) ends With Char return s != null && s.length() != 0 && s.charAt(s.length() - 1) == suffix;
|
boolean | endsWithChar(final String s, final char c) ends With Char if (s == null || s.length() == 0) { return false; return s.charAt(s.length() - 1) == c; |