python
In [1]: 'hoge,fuga,moge,'.replace(',', '') Out[1]: 'hogefugamoge'
javascript
最初の一つしか置換されない
'hoge,fuga,moge,'.replace(',', '') //-> "hogefuga,moge,"
すべて置換するには正規表現を使う
'hoge,fuga,moge,'.replace(/,/g, '') //-> "hogefugamoge"
牌語備忘録 -pygo
In [1]: 'hoge,fuga,moge,'.replace(',', '') Out[1]: 'hogefugamoge'
'hoge,fuga,moge,'.replace(',', '') //-> "hogefuga,moge,"
'hoge,fuga,moge,'.replace(/,/g, '') //-> "hogefugamoge"