code: public int lastIndexOf(final char ch, int startIndex) {
          startIndex = (startIndex >= size ? size - 1 : startIndex);
          if (startIndex < 0) {
              return -1;
          }
          for (int i = startIndex; i >= 0; i--) {
              if (buffer[i] == ch) {
                  return i;
              }
          }
          return -1;
      }
docs: Searches the string builder to find the last reference to the specified char.
  
  @param ch  the character to find
  @param startIndex  the index to start at, invalid index rounded to edge
  @return the last index of the character, or -1 if not found