begins-with
Version:
Checks if string begins with the given target string
56 lines (31 loc) • 767 B
Markdown
> Checks if string begins with the given target string
```
$ npm install --save begins-with
```
```js
var beginsWith = require('begins-with');
beginsWith('foo bar cat', 'foo');
//=> true
beginsWith('123foobar', '123foo');
//=> true
beginsWith('+lol+foo+bar', '+lol');
//=> true
beginsWith('foobar', 'cat');
//=> false
```
Checks if `string` begins with `match`
*Required*
Type: `string`
String to be tested against.
*Required*
Type: `string`
String to test with.
MIT © [Kevin Mårtensson](https://github.com/kevva)