Java String Last Index Of lastIndexOfLetter(String string)

Here you can find the source of lastIndexOfLetter(String string)

Description

last Index Of Letter

License

Open Source License

Declaration

public static int lastIndexOfLetter(String string) 

Method Source Code

//package com.java2s;

public class Main {
    public static int lastIndexOfLetter(String string) {
        for (int i = 0; i < string.length(); i++) {
            char character = string.charAt(i);
            if (!Character.isLetter(character) /*&& !('_'==character)*/) {
                return i - 1;
            }/*from  w  w  w .  j a v a2  s .c  o m*/
        }

        return string.length() - 1;
    }
}

Related

  1. lastIndexOfIgnoreCase(String source, String str, int fromIndex)
  2. lastIndexOfIgnoreCase(String str, String searchStr)
  3. lastIndexOfIgnoreCase(String str, String searchStr)
  4. lastIndexOfIgnoreCase(String str, String searchStr, int startPos)
  5. lastIndexOfImpl(final String str, final String search, final int fromIndex, final boolean ignoreCase)
  6. lastIndexOfNewline(CharSequence theChars, int aStart)
  7. lastIndexOfNonWhitespace(final String src)
  8. lastIndexOfOrdinal(String value, String part, int startIndex, int count, boolean caseSensitive)
  9. lastIndexOfPathSeparator(String str)