public int lastIndexOf(String subString,int start){
  int subCount=subString.length();
  if (subCount <= count && start >= 0) {
    if (subCount > 0) {
      if (start > count - subCount) {
        start=count - subCount;
      }
      char firstChar=subString.charAt(0);
      while (true) {
        int i=start;
        boolean found=false;
        for (; i >= 0; --i) {
          if (value[i] == firstChar) {
            found=true;
            break;
          }
        }
        if (!found) {
          return -1;
        }
        int o1=i, o2=0;
        while (++o2 < subCount && value[++o1] == subString.charAt(o2)) {
        }
        if (o2 == subCount) {
          return i;
        }
        start=i - 1;
      }
    }
    return start < count ? start : count;
  }
  return -1;
}

public int lastIndexOf ( String subString , int start ) { int subCount = subString . length ( ) ; if ( subCount <= count && start >= 0 ) { if ( subCount > 0 ) { if ( start > count - subCount ) { start = count - subCount ; } char firstChar = subString . charAt ( 0 ) ; while ( true ) { int i = start ; boolean found = false ; for ( ; i >= 0 ; -- i ) { if ( value [ i ] == firstChar ) { found = true ; break ; } } if ( ! found ) { return - 1 ; } int o1 = i , o2 = 0 ; while ( ++ o2 < subCount && value [ ++ o1 ] == subString . charAt ( o2 ) ) { } if ( o2 == subCount ) { return i ; } start = i - 1 ; } } return start < count ? start : count ; } return - 1 ; }
searches for the index of the specified character . the search for the character starts at the specified offset and moves towards the beginning .
