List of utility methods to do String Ends With
boolean | endsWithLineSeparator(final CharSequence msg) ends With Line Separator final int len = msg.length(); final String ls = LINE_SEPARATOR; if (ls != null && len > ls.length()) { final int end = len - ls.length(); return ls.equals(msg.subSequence(end, len)); return false; |
boolean | endsWithName(String subject, String endName) ends With Name if (!subject.endsWith(endName)) { return false; if (endName.length() == 0) { return true; final int deltaLength = subject.length() - endName.length(); if (deltaLength == 0) { ... |
boolean | endsWithNewline(String string) ends With Newline if (string.isEmpty()) { return false; final char character = string.charAt(string.length() - 1); return character == '\r' || character == '\n'; |
int | endsWithOne(final String src, final String[] dest) ends With One for (int i = 0; i < dest.length; ++i) { final String m = dest[i]; if (m != null) { if (src.endsWith(m)) { return i; return -1; |
int | endsWithOne(String src, String... dest) ends With One for (int i = 0; i < dest.length; i++) { String m = dest[i]; if (m != null) { if (src.endsWith(m)) return i; return -1; ... |
boolean | endsWithOneOf(String value, String... ends) Test if the String value ends with one of the specified ends. for (String end : ends) { if (value.endsWith(end)) { return true; return false; |
String | endsWithoutPathSeparator(final String path) Make sure a given path does not end with a path separator character. String returnedPath; if (path.endsWith("/") || path.endsWith("\\")) { returnedPath = path.substring(0, path.length() - 1); } else { returnedPath = path; return returnedPath; |
String | endsWithoutSlash(String url) ends Without Slash return url.endsWith("/") ? url.substring(0, url.length() - 1) : url; |
boolean | endsWithSentenceSeparator(char[] token) Check if token ends with a sentence separator return token.length > 2 && isSentenceSeparator(token[token.length - 1]);
|
boolean | endsWithSeparator(String str) ends With Separator return str != null && (str.endsWith("/") || str.endsWith("\\")); |