Reputation: 2781
I have tried to convert it to the array and then try to use join(',')
but this is not converting in a sentence can any buddy help on it.
convert this string
"[\"one\", \"two\", \"three\"]"
to sentence one, two, three
Updated:
**Solved this by gsub
.gsub(/(\[\"|\"\])/, '').split('", "')
I have used this and got [" one", "two", "three"]
, is there any other way to convert it like this
Upvotes: 0
Views: 145
Reputation: 926
Definitely not the prettiest of solutions, but you could have done something like:
eval("[\"one\", \"two\", \"three\"]")
Upvotes: 1