我知道你可以做這樣的事情:JavaScript的問題與string.replace
var str = "Microsoft has the largest capital reserves of any tech company. Microsoft is located in California.";
str = str.replace(/microsoft/gi, "Apple");
,你會得到如下:蘋果有任何科技公司的最大的資本儲備。蘋果公司位於加州。
如何使用全局不區分大小寫將07/08/2011等字符串更改爲07082011?
我嘗試了str.replace(/// gi,「」)的變體,但沒有運氣。
是不必要的 「我」在這種情況下。 –
是的,你是對的,更新。 – psynnott