Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 359 Bytes

stringReplace.md

File metadata and controls

23 lines (19 loc) · 359 Bytes

stringReplace

stringReplace

let a = 'abc';

a.replace(/ab/i, '');
a.replace(/ab/gi, '');
a.replace(/ab/ig, '');
a.replace(/ab/g, '');
a.replace(/ab/, '');
$a = "abc";
preg_replace("/ab/i", "", $a, 1);
preg_replace("/ab/i", "", $a);
preg_replace("/ab/i", "", $a);
preg_replace("/ab/", "", $a);
preg_replace("/ab/", "", $a, 1);