https://github.com/xotic750/string-includes-x
Determines whether one string may be found within another string.
https://github.com/xotic750/string-includes-x
browser includes javascript nodejs string
Last synced: 11 months ago
JSON representation
Determines whether one string may be found within another string.
- Host: GitHub
- URL: https://github.com/xotic750/string-includes-x
- Owner: Xotic750
- License: mit
- Created: 2017-08-24T14:33:12.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T23:02:16.000Z (about 3 years ago)
- Last Synced: 2025-03-05T16:45:38.536Z (11 months ago)
- Topics: browser, includes, javascript, nodejs, string
- Language: JavaScript
- Size: 2.11 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## string-includes-x
Determines whether one string may be found within another string.
### `module.exports` ⇒ boolean ⏏
This method determines whether one string may be found within another string,
returning true or false as appropriate.
**Kind**: Exported member
**Returns**: boolean - `true` if the given string is found anywhere within the
search string; otherwise, `false` if not.
**Throws**:
- TypeError If target is null or undefined.
- TypeError If searchString is a RegExp.
| Param | Type | Description |
| ------------ | ------------------- | -------------------------------------------------------------------------------------------- |
| string | string | The target string. |
| searchString | string | A string to be searched for within the target string. |
| [position] | number | The position within the string at which to begin searching for searchString.(defaults to 0). |
**Example**
```js
import strIncludes from 'string-includes-x';
const str = 'To be, or not to be, that is the question.';
includes(str, 'To be'); // true
includes(str, 'question'); // true
includes(str, 'nonexistent'); // false
includes(str, 'To be', 1); // false
includes(str, ('TO BE'); // false
```