Socket
Socket
Sign inDemoInstall

separate

Package Overview
Dependencies
2
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    separate

Separate a string at the specified indicies


Version published
Weekly downloads
102
increased by70%
Maintainers
1
Install size
14.5 kB
Created
Weekly downloads
 

Readme

Source

separate Build Status

Separate a string at the specified indicies

Install

$ npm install --save separate

Usage

var separate = require('separate')

separate('000551234', '-', [3, 5])
//=> 000-55-1234

API

separate(string, separator, separators) -> string
string

Required
Type: string

A string to separate.

separator

Required
Type: string

The string to use as a separator.

separators

Required
Type: array[number]

The numeric indicies at which separators should be inserted in the original string.

License

MIT © Ben Drucker

Keywords

FAQs

Last updated on 16 Sep 2015

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc