start-with
Determines whether a string begins with the characters of another string.
Last updated 10 years ago by bubkoo .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install start-with 
SYNC missed versions from official npm registry.

start-with Version Badge

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

ES2015 String#startsWith() ponyfill.

Ponyfill: A polyfill that doesn't overwrite the native method.

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.

Current Tags

  • 1.0.2                                ...           latest (10 years ago)

4 Versions

  • 1.0.2                                ...           10 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
  • 0.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (5)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |