# Intl.Collator - includes(), startsWith() and search()

**URL:** <https://es.discourse.group/t/intl-collator-includes-startswith-and-search/335>\
**Category:** 💡 Ideas\
**Tags:** proposal\
**Created:** [May 19, 2020, 3:25am UTC](https://es.discourse.group/t/intl-collator-includes-startswith-and-search/335 "2020-05-19T03:25:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![iced\_toast](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/iced_toast/32/318_2.png) [@iced\_toast](https://es.discourse.group/u/iced_toast)\
**Post date:** [May 19, 2020, 3:25am UTC](https://es.discourse.group/t/intl-collator-includes-startswith-and-search/335/1 "2020-05-19T03:25:16Z")

</div>

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, if `searchString` starts the `text` at `position`, false otherwise. `position` is `0`, if `undefined`.
- `includes(text, searchString, position)` - returns true, if `searchString` is anywhere in the `text` from position onwards (inclusive), false otherwise. `position` is `0`, if `undefined`.
- `search(text, searchString, position)` - returns an iterator, whose values are an object with `{index, match }` with index being the index into the `text`, and `match` being the found substring. `position` is `0`, if `undefined`.

From reading the [contributing documentation](https://github.com/tc39/ecma262/blob/bd868f20b8c574ad6689fba014b62a1dba819e56/CONTRIBUTING.md), 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?

---

<div class="post-metadata">

**Author:** ![jridgewell](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/jridgewell/32/18_2.png) [@jridgewell](https://es.discourse.group/u/jridgewell)\
**Post date:** [May 20, 2020, 6:24pm UTC](https://es.discourse.group/t/intl-collator-includes-startswith-and-search/335/2 "2020-05-20T18:24:02Z")

</div>

These all seem reasonable for the Intl specs, though there are more methods like `endsWith` and `indexOf`/`lastIndexOf`, etc.

Your best bet to get a champion is probably to open an issue on ECMA 402 (the Intl standard): [https://github.com/tc39/ecma402/blob/97c16d6a26425c2166e426d3b242233865012911/CONTRIBUTING.md](https://github.com/tc39/ecma402/blob/97c16d6a26425c2166e426d3b242233865012911/CONTRIBUTING.md), or to attend one of the monthly meetings.
