strChange(
const string, // string to treat
const oldpatt, // old pattern to be replaced
const newpatt, // new pattern
[const start, // start position in string (default = 1)
const count, // # of occurrences to replace (default = all)
const ignorecase]) // case independent search (default = false)
Replaces occurrences of a pattern by another text.
Examples:
const s = 'abc def ghi abc def';
strChange(s, 'abc', 'ABCX'); // ABCX def ghi ABCX def
strChange(s, 'abc', 'AB', 2); // abc def ghi AB def
strChange(s, 'abc', 'ABC', 1, 1); // ABC def ghi abc def
|