在Java中合并重复项Array

时间:2016-04-23 18:02:49

标签: java arrays merge duplicates

我有一个像:

这样的数组
{"education": ["place": "Washington", "education": "Bachelor", "Level": "2", ]},
{"education": ["place": "Washington", "education": "Master", "Level": "4", ]},
{"education": ["place": "New York", "education": "Bachelor", "Level": "3", ]},
{"education": ["place": "Atlanta", "education": "Bachelor", "Level": "1", ]},
{"education": ["place": "New York", "education": "Master", "Level": "4", ]}

我希望循环遍历这些数组并按地点分组并得到类似的内容:

{"education": ["place": "Washington", {"education": "Bachelor", "Level": "2"}, {"education": "Master", "Level": "4" }],
{"education": ["place": "New York", "education": "Bachelor", "Level": "3", ]},
{"education": ["place": "Atlanta", "education": "Bachelor", "Level": "1", ]},
{"education": ["place": "New York", "education": "Master", "Level": "4", ]}

0 个答案:

没有答案