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, ifsearchStringstarts thetextatposition, false otherwise.positionis0, ifundefined. -
includes(text, searchString, position)- returns true, ifsearchStringis anywhere in thetextfrom position onwards (inclusive), false otherwise.positionis0, ifundefined. -
search(text, searchString, position)- returns an iterator, whose values are an object with{index, match }with index being the index into thetext, andmatchbeing the found substring.positionis0, 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?