下のようにCoffeeScript組んだらエラーが発生した。
text = 'hoge foo' text = text.replace / /gi, ''で、文字列を直接しているのがいけないのかなーっと思って下のように書き直してもダメでした。
key = ' '
text = 'hoge foo'
text = text.replace /#{key}/gi, ''結果的にこれで落ち着いた。key = ' '
text = 'hoge foo'
text = text.replace ///#{key}///gi, ''
 
 
 
 
下記でどうでしょう?
返信削除text = 'hoge foo'
text = text.replace (/ /gi) , ''
試してみまっす!!
返信削除