How to split a delimited string in Ruby and convert it to an array?

I have a string

"1,2,3,4"

and I’d like to convert it into an array:

[1,2,3,4]

How?

5 Answers
5

Leave a Comment