我需要在Java中循环遍历一堆JSON片段,并从每个片段中提取两个数据。例如:
" ID":8041841931,"标题":"黑色""选项1":"黑色&#34 ;, "选项2":空,"选项3":空,"价格":" 83.79""克&#34 ;: 4706" compare_at_price":空," SKU":""" requires_shipping":真,"征税" :真,"位置":3," PRODUCT_ID":2759169283," created_at":" 2015-09-23T20:51:28-04: 00""的updated_at":" 2015-09-23T20:51:28-04:00""购":真," featured_image":空},
我需要跟踪"价格"和"克"然后,每个片段最终按克的升序对它们进行排序。这些片段都包含在 String [] 的数组中。这样做最好的方法是什么?