Skip to content

afeiship/next-array-replace

Repository files navigation

next-array-replace

Multiple replace for array.

version license size download

installation

npm install -S @jswork/next-array-replace

usage

import '@jswork/next-array-replace';

const arr= [
  [/a/g,'A'],
  ['hello','world']
];
const str = 'aaa-bbb-1234 hello Fei!';
const res = nx.arrayReplace( str, arr);

// AAA-bbb-1234 world Fei!

license

Code released under the MIT license.