localeIncludes()
String.prototype.includes()
but using localeCompare
.
Install
npm i locale-includes
Syntax
localeIncludes(string, searchString[, options])
Parameters
-
string
(string)
A string to be searched within.
-
searchString
(string)
A string to be searched for within string
.
-
options
(object) - Optional
An object with some or all of the following properties:
Return value
- (bool)
Whether the search string is found anywhere within the given string or not.
Examples
import {localeIncludes} from `locale-includes`;
localeIncludes("Abcdef", "cde");
localeIncludes("Abcdef", "cde", {position: 3});
localeIncludes("àḃḉdÉf", "bCde", {usage: "search", sensitivity: "base"});
See also
String.prototype.includes()
String.prototype.localeCompare()