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
329971
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;
    }
614090
public int getValue(int ch) 
    {
        // valid, uncompacted trie and valid c?
        if (m_isCompacted_ || ch > UCharacter.MAX_VALUE || ch < 0) {
            return 0;
        }
    
        int block = m_index_[ch >> SHIFT_];
        return m_data_[Math.abs(block) + (ch & MASK_)];
    }
179379
static private int indexOfNthOccurrenceOfCharIn(String str, char ch, int n) {
        boolean inMiddleOfQuote = false;
        int index = -1, previousIndex = 0;
        for (int i=0; i < n; i++) {
            do {
                index = str.indexOf(ch, index+1);
                if (index < 0) {
                    return -1;
                }
                if (hasOddNumberOfSingleQuotes(str.substring(previousIndex, index))) {
                    inMiddleOfQuote = !inMiddleOfQuote;
                }
                previousIndex = index;
            } while (inMiddleOfQuote);
        }
        return index;
    }
1216098
private int findFrom(char c, int index) {
        int currentIdx = index;
        while (currentIdx < buffer.length()) {
            if (buffer.get(currentIdx) == c) {
                return currentIdx;
            }
            currentIdx++;
        }
        return -1;
    }
875003
@Override
  protected int nextEscapeIndex(CharSequence csq, int index, int end) {
    for (; index < end; index++) {
      char c = csq.charAt(index);
      if (c >= safeOctets.length || !safeOctets[c]) {
        break;
      }
    }
    return index;
  }
206254
public static int nthIndex(String s, char ch, int n) {
    int index = 0;
    for (int i = 0; i < n; i++) {
      // if we're already at the end of the string,
      // and we need to find another ch, return -1
      if (index == s.length() - 1) {
        return -1;
      }
      index = s.indexOf(ch, index + 1);
      if (index == -1) {
        return (-1);
      }
    }
    return index;
  }
291930
static char getFirstCharLocName(String name) {
        final char first;
        int i = name.indexOf('}');
        if (i < 0)
            first = name.charAt(0);
        else
            first = name.charAt(i+1);
        return first;
    }
491192
public boolean contains(final char ch) {
        final char[] thisBuf = buffer;
        for (int i = 0; i < this.size; i++) {
            if (thisBuf[i] == ch) {
                return true;
            }
        }
        return false;
    }
590577
final int getIndexValue() {
        if (anteContextLength == pattern.length()) {
            // A pattern with just ante context {such as foo)>bar} can
            // match any key.
            return -1;
        }
        int c = UTF16.charAt(pattern, anteContextLength);
        return data.lookupMatcher(c) == null ? (c & 0xFF) : -1;
    }
56169
public Trie lookup(char ch) {
    int i = Arrays.binarySearch(childMap, ch);
    return i >= 0 ? children[i] : null;
  }
138381
public static boolean isLetter(String str, int beginIndex, int endIndex)
    {
        for ( int i = beginIndex; i < endIndex; i++ ) {
            char chr = str.charAt(i);
            if ( ! StringUtil.isEnLetter(chr) ) {
                return false;
            }
        }

        return true;
    }
656306
private int findRightBrace(char chLeft, char chRight, int fromIndex) {

        int level = 0; // 记录括号重叠级别。

        // 查找匹配的右括号。
        for (int index = fromIndex; index < length; index++) {

            char ch = pattern.charAt(index);

            // 如果出现左括号，重叠级别增加。
            if (ch == chLeft) {
                level++;
            }
            // 如果出现右括号，重叠级别降低。
            else if (ch == chRight) {

                if (level == 0) {
                    // 找到右括号。
                    return index;
                }

                level--;
            }
        }

        // 没有找到匹配的括号。
        return -1;
    }
268607
public static boolean isLetter(int ch)
    {
        // if props == 0, it will just fall through and return false
        return ((1 << getType(ch))
                & ((1 << UCharacterCategory.UPPERCASE_LETTER)
                        | (1 << UCharacterCategory.LOWERCASE_LETTER)
                        | (1 << UCharacterCategory.TITLECASE_LETTER)
                        | (1 << UCharacterCategory.MODIFIER_LETTER)
                        | (1 << UCharacterCategory.OTHER_LETTER))) != 0;
    }
908641
public char getCharacter(final int index) {
		if (index > characters.length) {
			throw new IndexOutOfBoundsException(index + "@" + characters.length + " does not fit");
		}
		return characters[index];
	}
859400
private static int _indexOf(@Nonnull String s, char ch) {
        int idx = s.indexOf(ch);
        if (idx<0)  return s.length();
        return idx;
    }
1102508
private int findIndexOfFrom(String query) {
    if (query.startsWith("from")) return 0;
    int fromIdx = query.indexOf(" from ");
    if (-1 == fromIdx) return -1;
    final int first = query.substring(0, fromIdx).indexOf("(");
    if (first > 0) {
      int leftCnt = 1;
      int i = first + 1;
      while (leftCnt != 0 && i < query.length()) {
        if (query.charAt(i) == '(') leftCnt++;
        else if (query.charAt(i) == ')') leftCnt--;
        i++;
      }
      if (leftCnt > 0) return -1;
      else {
        fromIdx = query.indexOf(" from ", i);
        return (fromIdx == -1) ? -1 : fromIdx + 1;
      }
    } else {
      return fromIdx + 1;
    }
  }
244542
public boolean contains(final char ch) {
        for (final CharRange range : set) {
            if (range.contains(ch)) {
                return true;
            }
        }
        return false;
    }