javascript 字串取代

"aaa,bbb,ccc".replace(",", "|") // 只能取代一次
"aaa,bbb,ccc".replace(/,/g, "|") // 可以取代所有符合的字串

留言

熱門文章