replace替换所有

eg:替换所有的逗号为|

str.replace(/\,/g, "|");

注意:/g为标识全文匹配

posted @ 2016-01-21 18:29  暗夜心慌方  阅读(769)  评论(0)    收藏  举报