我得到这个阵列的难匹配:数组元素
@array = [["1003", "4"], ["963", "3"], ["1006", "1"], ["1064", "1"], ["1095", "1"], ["963", "http://www.google.com/1"], ["1003", "http://www.google.com/2"]]
,我需要这个作为结果:
@array = [["1003", "http://www.google.com/2"], ["963", "http://www.google.com/1"]]
- 匹配每[0]彼此,如果它符合一套“ http:link“链接到[1]。
- 删除所有没有匹配的entrys。
这怎么可能?
你需要一个'to_a'来匹配OP的输出。 – iain 2012-01-06 17:55:25
最后还有一个'to_a',因此它是OP所要求的数组格式。 – 2012-01-06 17:57:27
你让我的一天,thx很多! – 2012-01-09 09:04:23