我有JSON对象,需要按字母顺序对对象进行排序。
JSON j = {"Peter" : {"list" : ["/classroom/Sam" , "/classroom/Tom" , "/classroom/Arc" , "/classroom/Jerry"], "type" : Response"}}
最终目标是比较实际和预期的json对象。值相同但值的顺序不同。所以需要在比较之前对实际和预期的对象进行排序。
我需要对["/classroom/Sam" , "/classroom/Tom" , "/classroom/Arc" , "/classroom/Jerry"]