public static int lastIndexNotOf(String str,String chars,int fromIndex){
  fromIndex=Math.min(fromIndex,str.length() - 1);
  for (int pos=fromIndex; pos >= 0; pos--) {
    if (chars.indexOf(str.charAt(pos)) < 0) {
      return pos;
    }
  }
  return -1;
}

public static int lastIndexNotOf ( String str , String chars , int fromIndex ) { fromIndex = Math . min ( fromIndex , str . length ( ) - 1 ) ; for ( int pos = fromIndex ; pos >= 0 ; pos -- ) { if ( chars . indexOf ( str . charAt ( pos ) ) < 0 ) { return pos ; } } return - 1 ; }
finds the last index in str of a character not in the characters in ' chars ' ( similar to ansi string . find_last_not_of ) . returns - 1 if no such character can be found .
