I have this string :
temp = "["minutes", "hours"]"
If I do this:
temp[1..-2].split(", ")
I get an array of 2 elements like this:
[0] = ""minutes""
[1] = ""hours""
How can I avoid to have double quotes?
I have this string :
temp = "["minutes", "hours"]"
If I do this:
temp[1..-2].split(", ")
I get an array of 2 elements like this:
[0] = ""minutes""
[1] = ""hours""
How can I avoid to have double quotes?
Just do:
temp.gsub("\"", "")[1..-2].split(", ")
Or, once you have the array with double quotes on each element:
temp.map{|e| e.squeeze("̣\"")}