Answer the question
In order to leave comments, you need to log in
How to convert a string into an array?
Hello. How can I convert a string into an array? The example below does not work. Thank you.
require 'json'
str = '[ { :aa => "1" }, { :aa => "2" } ]'
value = JSON.parse( str )
puts str
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question