我有这个数组:
parsed_data = ["Mike Henry,7/7/87,Oakland,831 123-2758", "David Jordan,12/30/92,Bangkok,831 229-1234", "Matt Rosen,5/21/89,Seattle,925 518-9933"]
我想将其转换为:
[["Mike Henry", "7/7/87", "Oakland", "831 123-2758"],["David Jordan", "12/30/92", "Bangkok", "831 229-1234"],["Matt Rosen", "5/21/89", "Seattle", "925 518-9933"]]
我努力了
parsed_data = parsed_data.each do |file|
file.split(",")
end
但它返回我的原始数组。任何帮助是极大的赞赏!