1.0.1 • Published 9 years ago

separate v1.0.1

Weekly downloads
507
License
MIT
Repository
github
Last release
9 years ago

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