Matches characters in a string against a prefix and return
the number of chars that matched, or 0 if no match. Only
primary-order differences are significant in determining
whether there's a match. This means that the returned
value need not be the same as the length of the prefix.
str - The string being tested
prefix - The text we're hoping to see at the beginning of "str"
the number of characters in "str" that were matched
Searches a string for another string. This might use a
Collator to compare strings, or just do a simple match.
str - The string to search
key - The string to search "str" for
startingAt - The index into "str" where the search is to
A two-element array of ints. Element 0 is the position
of the match, or -1 if there was no match. Element 1 is the
number of characters in "str" that matched (which isn't necessarily
the same as the length of "key")