starts-with
Returns
true
if the given string or array starts with prefix using strict equality for comparisons. Using fastest implementation.
Install
npm i starts-with --save
npm test
Usage
For more use-cases see the tests
var startsWith = //=> true //=> true //=> false //=> false //=> true //=> false //=> true
Related
- ends-with: Returns
true
if the givenstring
orarray
ends withsuffix
using strict equality for comparisons. - each-string-index: Get the index for each occurrence of a string, in a string. Much faster than regex, and useful for doing simple find and replace operations for specific strings.
- starts-with-any: Returns true if the given string or array begins with any of the given substrings.
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.