我正在获取我的 json 响应并对其进行解析,我能够分别获得以下模型和标识符(见下文)。现在,我只需要按模型对它们进行排序,不区分大小写。因此,如果我创建一个数组,那么仅按模型排序就会变得很困难,如果不是不可能的话,如果我进行哈希,我将无法创建重复的键(模型)。
那么对这个 json 响应进行排序的最佳方法是什么?谢谢 !!
this is the model: 1 Series
this is the identifier: Convertible
this is the model: 1 Series
this is the identifier: Coupe
this is the model: 1 Series M
this is the identifier: Coupe
this is the model: 3 Series
this is the identifier: Convertible
this is the model: 3 Series
this is the identifier: Coupe
this is the model: 3 Series
this is the identifier: Diesel
this is the model: 3 Series
this is the identifier: Sedan
this is the model: 3 Series
this is the identifier: Wagon
this is the model: ALPINA B7
this is the identifier: Sedan
this is the model: ActiveHybrid 5
this is the identifier: Sedan
this is the model: ActiveHybrid 7
this is the identifier: Sedan
this is the model: ActiveHybrid X6
this is the identifier: SUV