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

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -