gsub用于删除括号和\来自字符串

DMH*_*DMH 0 ruby

我使用的问题gsub删除[],并\"从一个字符串.这是字符串:

"[\"This is a word ect\", \"Char2\", \"Another grooup\", \"Char4\"]"
Run Code Online (Sandbox Code Playgroud)

我希望返回值为:

"This is a word ect, Char2, Another grooup, Char4"
Run Code Online (Sandbox Code Playgroud)

谁能指出我正确的方向?

Ale*_*kin 8

只是出于好奇:

str = '["This is a word ect", "Char2", "Another grooup", "Char4"]'
require 'json'
JSON.parse(str).join(', ')
#? "This is a word ect, Char2, Another grooup, Char4"
Run Code Online (Sandbox Code Playgroud)