Skip to content

Determines whether a string begins with the characters of another string.

License

Notifications You must be signed in to change notification settings

acagastya/start-with

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

start-with Version Badge

Determines whether a string begins with the characters of another string.

ES2015 String#startsWith() ponyfill.

MIT License

build:? coverage:?

Install

$ npm install --save start-with 

Usage

For more use-cases see the tests

var startWith = require('start-with');

startWith('abcde', 'a');  // => true
startWith('abcde', 'ab'); // => true
startWith('abcde', 'bc'); // => false
startWith('abcde', '');   // => true
startWith('abcde');       // => false
startWith('abcde', null); // => false

Related

  • end-with - Determines whether a string ends with the characters of another string.
  • pad-start - ES spec-compliant String.prototype.padStart shim.
  • pad-end - ES spec-compliant String.prototype.padEnd shim.

Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please create an issue.

About

Determines whether a string begins with the characters of another string.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%