ruby - gsub for removing brackets and \ from string -
i have issues using gsub
remove []
, \"
string. here string:
"[\"this word ect\", \"char2\", \"another grooup\", \"char4\"]"
i want returned value be:
"this word ect, char2, grooup, char4"
can point me in right direction?
just out of curiosity:
str = '["this word ect", "char2", "another grooup", "char4"]' require 'json' json.parse(str).join(', ') #⇒ "this word ect, char2, grooup, char4"
Comments
Post a Comment