Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

readme.md

splice-string Build Status

Remove or replace part of a string like Array#splice

Install

$ npm install --save splice-string

Usage

const spliceString = require('splice-string');

spliceString('unicorn', 3, 4, 'verse');
//=> 'universe'

spliceString('❤️🐴🐴', 1, 1, '🦄');
//=> '❤️🦄🐴'

API

spliceString(input, index, count, [insert])

input

Type: string

index

Type: number

Index to start splicing.

count

Type: number

Number of characters to remove.

insert

Type: string

String to insert in place of the removed substring.

License

MIT © Sindre Sorhus

About

Remove or replace part of a string like Array#splice

Resources

License

You can’t perform that action at this time.