js替换字符串中所有指定的字符
摘要:第一次发现JavaScript中replace() 方法如果直接用str.replace("-","!") 只会替换第一个匹配的字符. 而str.replace(/\-/g,"!")则可以全部替换掉匹配的字符(g为全局标志)。 replace() The replace() method retur
阅读全文
posted @ 2016-06-01 10:46
posted @ 2016-06-01 10:46
posted @ 2016-03-11 11:47
posted @ 2016-03-11 10:36