This function mirrors the indexOf function from the JavaScript Standard String object. It
operates on grapheme clusters instead of UTF-16 code units.
Returns the index of the first occurrence of a given string, or -1 if it is not found. Only an
occurrence that begins and ends on a grapheme cluster boundary counts as a match.
Parameters
string: string
String to search through
searchString: string
The string to search for
Optionalposition: number
Where to start searching. Negative values clamp to 0. Default is 0
Returns number
Index of the first occurrence of the given string, or -1
This function mirrors the
indexOffunction from the JavaScript Standard String object. It operates on grapheme clusters instead of UTF-16 code units.Returns the index of the first occurrence of a given string, or -1 if it is not found. Only an occurrence that begins and ends on a grapheme cluster boundary counts as a match.