2 ooomiao oOOMIAO 于 2013.03.18 11:07 提问

关于在数组中排序多个值

有一个数组,其中有多个state。

{"location":"Lekki Phase 1","state":"abc","country":"Nigeria"},
{"location":"Lekki Phase 2","state":"xyz","country":"Nigeria"},
{"location":"Osapa London1","state":"def","country":"Nigeria"},
{"location":"Lekki Phase 2","state":"abc","country":"Nigeria"},
{"location":"Lekki Phase 3","state":"xyz","country":"Nigeria"},
{"location":"Osapa London 2","state":"def","country":"Nigeria"},..........

现在我可以做出一个没有重复的state数组。

{"abc","xyz","def"}

我想要在一个表显示所有的location state。

应该怎么实现?

1个回答

csxrzeng
csxrzeng   2015.06.05 10:29

遍历……,貌似我只能想到这种办法

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!