- Perform a global replacement:
var string = "HeLLo world!";
Result: "HeLLo word!"
var result = string.replace(/l/g, ""); - Perform a global, case-insensitive replacement:
var string = "HeLLo world!";
Result: "Heo word!"
var result = string.replace(/l/gi, "");
No comments:
Post a Comment