List of utility methods to do String Last Index Of
int | lastIndexOfLetter(String string) last Index Of Letter for (int i = 0; i < string.length(); i++) { char character = string.charAt(i); if (!Character.isLetter(character) ) { return i - 1; return string.length() - 1; |
int | lastIndexOfNewline(CharSequence theChars, int aStart) Returns index of the previous newline (or carriage-return/newline) in given chars starting at given char index. for (int i = aStart - 1; i >= 0; i--) { char c = theChars.charAt(i); if (c == '\n') return i - 1 >= 0 && theChars.charAt(i - 1) == '\r' ? (i - 1) : i; if (c == '\r') return i; return -1; ... |
int | lastIndexOfNonWhitespace(final String src) last Index Of Non Whitespace return lastIndexOfNonWhitespace(src, src.length(), 0);
|
int | lastIndexOfOrdinal(String value, String part, int startIndex, int count, boolean caseSensitive) Performs an ordinal string comparison. int valueLen = value.length(); int partLen = part.length(); int endIndex = startIndex - count + 1; if ((valueLen == 0) && (startIndex == -1 || startIndex == 0)) if (partLen != 0) return -1; else return 0; ... |
int | lastIndexOfPathSeparator(String str) last Index Of Path Separator if (str == null) return -1; int length = str.length(); for (int i = length - 1; i >= 0; i--) { char c = str.charAt(i); if (c == '/' || c == '\\') { return i; return -1; |
int | lastIndexOfSeparator(String path) This routine returns last index of separator in input param "path", and return it. return Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\")); |
int | lastIndexOfUCL(String value) last Index Of UCL for (int i = value.length() - 1; i >= 0; i--) { if (Character.isUpperCase(value.charAt(i))) { return i; return -1; |
int | lastIndexOfUnnested(String str, char chr, String openBalance, String closeBalance) last Index Of Unnested return lastIndexOfUnnested(str, chr, str.length() - 1, openBalance, closeBalance);
|
int | lastIndexOfWhitespace(String s) last Index Of Whitespace for (int i = s.length() - 1; i >= 0; i--) if (s.charAt(i) <= ' ') return i; return -1; |