I'm wanting to submit a proposal to add locale-sensitive string operations to Intl.Collator
, in particular startsWith()
, includes()
and search()
. Current String.prototype functions don't work well with some text, such as STRASSE and straße
Brief "documentation" follows:
-
startsWith(text, searchString, position)
- returns true, ifsearchString
starts thetext
atposition
, false otherwise.position
is0
, ifundefined
. -
includes(text, searchString, position)
- returns true, ifsearchString
is anywhere in thetext
from position onwards (inclusive), false otherwise.position
is0
, ifundefined
. -
search(text, searchString, position)
- returns an iterator, whose values are an object with{index, match }
with index being the index into thetext
, andmatch
being the found substring.position
is0
, ifundefined
.
From reading the contributing documentation, provided there are no objections here and someone is willing to champion this, my next step is to create a pull-request and incorporate feedback from here?