0.0.3 • Published 6 years ago

string-batch-replace v0.0.3

Weekly downloads
16
License
-
Repository
-
Last release
6 years ago

string-batch-replace

installation

# npm
npm install string-batch-replace


# yarn
yarn install string-batch-replace

usage

import {strintBatchReplace, EDIT_TYPE} from 'string-batch-replace'

let nextText = stringBatchReplace("abc",[
    {
        type: EDIT_TYPE.insert,
        text:"x",
        start:1
    },
    {
        type:EDIT_TYPE.replace,
        text:"yy",
        start:2,
        end:3
    }
])

// should output axbyy
console.log(newText)