I currently have an array of arrays. There are 10 single-item arrays in my overall array
我目前有一个数组数组。我的整个数组中有10个单项数组
[["http://instagr.am/r/123"],["http://instagr.am/r/456"]....]
[[ “http://instagr.am/r/123”],[ “http://instagr.am/r/456”] ....]
My goal is to clean this up so that it is an array of strings.
我的目标是清理它,以便它是一个字符串数组。
Ex:
例如:
[http://instagr.am/r/123, http://instagr.am/r/456, ... ]
[http://instagr.am/r/123,http://instagr.am/r/456, ...]
I have been racking Google trying to find a solution for this but I seem to be unable to find one and I was hoping that you kind folks could help out an emerging Rubyist.
我一直在努力为谷歌寻找解决方案,但我似乎无法找到一个,我希望你善良的人可以帮助一个新兴的Rubyist。
2 个解决方案
#2
2
array.map(&:first)
...............
...............
#1
#2
2
array.map(&:first)
...............
...............