JSON data processing

Source: Internet
Author: User
Tags convert string to json string to json

1. Convert string to JSON array: Take JSON object property value.

String st= "[{" Tradedate ":" 2016-09-27 "," Tradetime ":" 09:17 "," tradeproject ":" Drip Express-Huang Ganong master "," Tradeotherside ":" Beijing Tongda Infinity Technology Co., Ltd. "," Tradeothersidename ":", "Tradeothersideaccount": "", "Tradeamount": 52.30, "tradestatus": 501},{" Tradedate ":" 2016-10-13 "," Tradetime ":" 09:17 "," tradeproject ":" Drip Express-Huang Ganong master "," Tradeotherside ":" Beijing Tongda Infinity Technology Co., Ltd. "," Tradeothersidename ":", "Tradeothersideaccount": "", "Tradeamount": 32.30, "tradestatus": 501},{"tradedate": " 2016-10-13 "," Tradetime ":" 09:50 "," tradeproject ":" Drip Express-Fezeron Master "," Tradeotherside ":" Beijing Tongda Infinity Technology Co., Ltd. "," Tradeothersidename ":", "Tradeothersideaccount": "", "Tradeamount": 33.80, "tradestatus": 4},{"tradedate": " 2016-10-14 "," Tradetime ":" 09:59 "," tradeproject ":" Drip Express-Shen Fangliang master "," Tradeotherside ":" Beijing Tongda Infinity Technology Co., Ltd. "," Tradeothersidename ":", "Tradeothersideaccount": "", "Tradeamount": 37.60, "tradestatus": 7},{"tradedate": " 2016-10-15 "," Tradetime ":" 17:28 "," tradeproject ":" Drip Express-Yang Zhengsong master "," Tradeotherside ":" Beijing Tongda Infinity Technology Co., Ltd. "," Tradeothersidename ":", "Tradeothersideaccount": "", "Tradeamount": 25.10, "tradestatus": 8},{"tradedate": "2016-10-16 "," Tradetime ":" 15:42 "," tradeproject ":" Drip Express-Zhu Longwen master "," Tradeotherside ":" Beijing Tongda Infinity Technology Co., Ltd. "," Tradeothersidename ":", "Tradeothersideaccount": "", "Tradeamount": 47.20, "tradestatus": 601},{"tradedate": " 2016-10-18 "," Tradetime ":" 10:07 "," tradeproject ":" Drip Express-Zhangxia Master "," Tradeotherside ":" Beijing Tongda Infinity Technology Co., Ltd. "," Tradeothersidename ":", "Tradeothersideaccount": "", "Tradeamount": 35.70, "tradestatus": 601},{"tradedate": " 2016-10-21 "," Tradetime ":" 09:59 "," tradeproject ":" Drip Express-Yang Mei floor master "," Tradeotherside ":" Beijing Tongda Infinity Technology Co., Ltd. "," Tradeothersidename ":", "Tradeothersideaccount": "", "Tradeamount": 37.90, "Tradestatus": 601}] "

Jsonarray Jsarray = Json.parsearray (ST);

Jsonobject jsonobject =jsarray.getjsonobject (i);

String date = jsonobject.getstring ("Tradedate");

String time = jsonobject.getstring ("Tradetime");

JSON data processing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.