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

Popular posts from this blog

command line - Use qwinsta in PowerShell ISE -

java - Incorrect order of records in M-M relationship in hibernate -

Python website log in: BIG-IP can not find session information in the request -