New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

split-on-first-occurrence

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

split-on-first-occurrence

Split a string on the first occurrence of a char

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
13
85.71%
Maintainers
1
Weekly downloads
 
Created
Source

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

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

License

MIT © EGOIST

Keywords

split

FAQs

Package last updated on 06 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts