--- tags: Javascript --- # JS去除字串所有逗號 第一個參數可以放要替換的regexp規則,第二個參數放要替換成甚麼字串 ```javascript= str = "水果,葡萄,青椒" str = str.replace(/,/g, ""); console.log(str); // 水果葡萄青椒 ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up