My string:
>> pp params[:value]
"07016,07023,07027,07033,07036,07060,07062,07063,07065,07066,07076,07081,07083,07088,07090,07092,07201,07202,07203,07204,07205,07206,07208,07901,07922,07974,08812,07061,07091,07207,07902"
How can this become an array of separate numbers like :
["07016", "07023", "07033" ... ]
result = params[:value].split(/,/)
String#split is what you need
Try this:
arr = "07016,07023,07027".split(",")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With