Reputation: 6384
I know you can do something like this:
var str = "Microsoft has the largest capital reserves of any tech company. Microsoft is located in California.";
str = str.replace(/microsoft/gi, "Apple");
and you'd get the following: Apple has the largest capital reserves of any tech company. Apple is located in California.
How can I use the global case insensitive to change a string like 07/08/2011 to 07082011?
I tried variations of str.replace(///gi, "") with no luck.
Upvotes: 0
Views: 68
Reputation: 17427
Try this:
var input = "07/08/2011";
var output = input.replace(/\//g,""); //output 07082011
Upvotes: 2
Reputation: 3414
try using escape character (back slash):
str.replace(/\//gi, "")
Upvotes: 0