common-prefix

v1.1.0
Retrieve the common prefix across multiple strings
common prefix string start first same

common-prefix stable

Retrieve the common prefix across multiple strings.

Usage

NPM

str = common(strings)

For example:

var common = require('common-prefix')

common([
    'hello world'
  , 'hello again'
  , 'hello once again'
]) === 'hello '

License

MIT. See LICENSE.md for details.

npm i common-prefix

Metadata

  • MIT
  • Whatever
  • Hugh Kennedy
  • released 3/9/2016

Downloads

Maintainers