List of utility methods to do String Ends With
boolean | endsWith(String str, String end, boolean caseSensitive) ends With if (str == null || end == null) { return (str == null && end == null); if (end.length() > str.length()) { return false; int offset = str.length() - end.length(); return str.regionMatches(caseSensitive, offset, end, 0, end.length()); ... |
boolean | endsWith(String str, String mark) ends With return startsWith(str, mark, str.length() - mark.length());
|
boolean | endsWith(String str, String suffix) Check if a String ends with a specified suffix.
return endsWith(str, suffix, false);
|
boolean | endsWith(String str, String suffix)StringUtilities.endsWith(null, null) = true StringUtilities.endsWith(null, "def") = false StringUtilities.endsWith("abcdef", null) = false StringUtilities.endsWith("abcdef", "def") = true StringUtilities.endsWith("ABCDEF", "def") = false StringUtilities.endsWith("ABCDEF", "cde") = false return endsWith(str, suffix, false);
|
boolean | endsWith(String str, String suffix, boolean ignoreCase) ends With if (str == null || suffix == null) return str == null && suffix == null; int suffixLength; int length; if ((suffixLength = suffix.length()) > (length = str.length())) return false; return str.regionMatches(ignoreCase, length - suffixLength, suffix, 0, suffixLength); |
boolean | EndsWith(String str, String suffix, int strStartPos) Ends With if (str == null) { throw new NullPointerException("str"); if (suffix == null) { throw new NullPointerException("suffix"); if (strStartPos < 0) { throw new IllegalArgumentException("strStartPos (" + strStartPos + ") is less than " + "0"); ... |
boolean | endsWith(String string, char character) ends With return lastChar(string) == character;
|
boolean | endsWith(String string, String... end) ends With for (String s : end) { if (string.endsWith(s)) return true; return false; |
boolean | endsWith(String string, String... endsWithText) return true if the string endsWith in any endsWithText if (endsWithText != null) { for (String endWithText : endsWithText) { if (string.endsWith(endWithText)) { return true; return false; ... |
boolean | endsWith(String value, String[] suffixes) ends With if (value != null && suffixes != null) { for (String suffix : suffixes) { if (value.endsWith(suffix)) { return true; return false; ... |