split-on-first-occurrence

1.0.2 • Public • Published

split-on-first-occurrence

NPM version NPM downloads Build Status

Install

$ npm install --save split-on-first-occurrence

Usage

const split = require('split-on-first-occurrence')

split('Author: EGOIST COOL', ' ')
//=> ['Author:', 'EGOIST COOL']

// split by a string
split('Hello\n\nWorld\n\n!', '\n\n')
//=> ['Hello', 'World\n\n!']

API

split(input, char)

input

Type: string

The string to split.

char

Type: string

The seperator char or chars.

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

MIT © EGOIST

Readme

Keywords

Package Sidebar

Install

npm i split-on-first-occurrence

Weekly Downloads

55

Version

1.0.2

License

MIT

Last publish

Collaborators

  • rem