Popularity
1.0
Stable
Activity
0.0
Stable
14
8
3

Monthly Downloads: 674
Programming language: JavaScript
License: MIT License
Tags: Text     String     Str     Modify     Delete     Remove     Del     Rm     Add     Insert     Replace     Mutate     Split     Splice    
Latest version: v2.0.0

splice-string alternatives and similar modules

Based on the "Text" category

Do you think we are missing an alternative of splice-string or a related project?

Add another 'Text' Module

README

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


*Note that all licence references and agreements mentioned in the splice-string README section above are relevant to that project's source code only.