code: private int prefixLength(String str, String prefix) {
          // if we're looking for an empty prefix, it obviously matches
          // zero characters.  Just go ahead and return 0.
          if (prefix.length() == 0) {
              return 0;
          }
  
          RbnfLenientScanner scanner = formatter.getLenientScanner();
          if (scanner != null) {
              return scanner.prefixLength(str, prefix);
          }
  
          // If lenient parsing is turned off, forget all that crap above.
          // Just use String.startsWith() and be done with it.
          if (str.startsWith(prefix)) {
              return prefix.length();
          }
          return 0;
      }
docs: Used by stripPrefix() to match characters.  If lenient parse mode
  is off, this just calls startsWith().  If lenient parse mode is on,
  this function uses CollationElementIterators to match characters in
  the strings (only primary-order differences are significant in
  determining whether there's a match).
  @param str The string being tested
  @param prefix The text we're hoping to see at the beginning
  of "str"
  @return If "prefix" is found at the beginning of "str", this
  is the number of characters in "str" that were matched (this
  isn't necessarily the same as the length of "prefix" when matching
  text with a collator).  If there's no match, this is 0.