Java handles escape slashes in JSON-formatted data

Source: Internet
Author: User

1, {\ "count\": \ "3\", \ "errorstring\": \ "\", \ "success\": True,\ "url\": \ "http:\\\/\\\/172.16.80.65:8080\\\/ Loginsso.aspx? Usercode=wubg&type=workitem\ ", \" userid\ ": \" 1226\ ", \" biztype\ ": \" 19110\ ", \" Results\ ": [{\" activityid\ ": \" 6d216e2b-25dc-4978-88a8-2fb5bfbd690c\ ", \" activityname\ ": \" department head \ ", \" money\ ": \" \ ", \" participantid\ ": \" 1226\ ", \" Participantname\ ": \" Wu precious \ ", \" preactivityname\ ": \" \ ", \" starttime\ ": \" 2017\\\/6\\\/21 20:55:59\ ", \" state\ ": \" 0\ ", \ "type\": \ "asset disposition \", \ "workid\": \ "46789861-4dc5-4dd9-87e0-5cb4df8bf3ff\", \ "workitemurl\": \ "Sbmanager\\\/equipment_ Assetdispose_new.aspx?sitemap= ' Location: Life cycle Management > Asset Disposition > Department head ' \ '},{\ ' activityid\ ": \" 05ec02e4-6e11-4791-b2ed-9debf6fef516\ ", \" activityname\ ": \" Departmental leadership opinion \ ", \" money\ ": \" \ ", \" participantid\ ": \" 1226\ ", \ "participantname\": \ "Wu precious \", \ "preactivityname\": \ "\", \ "starttime\": \ "2017\\\/6\\\/21 20:41:57\", \ "state\": \ "0\", \ "type\": \ "asset out of library \", \ "workid\": \ "56ae6661-4379-4b25-b231-2586609d0e11\", \ "workitemurl\": \ "databasebef\\\/ Equipment_yanshou_ck_new.aspx?sitemap= ' Location: Lifecycle Management > Acceptance Outbound > Departmental leadership opinions ' \ "},{\" activityid\ ": \" 9f0cc043-6bea-446c-90ac-1b228450ebd0\ ", \" Activityname\ " : \ "Use department head opinion \", \ "money\": \ "\", \ "participantid\": \ "1226\", \ "participantname\": \ "Wu precious \", \ "preactivityname\": \ "\", \ "starttime\": \ "2017\\\/6\\\/21 21:25:56\", \ "state\": \ "0\", \ "type\": \ "Picking out the library list \", \ "workid\": \ " 980ee135-2587-4469-9b5a-8929afcfc728\ ", \" workitemurl\ ": \" sbmanager\\\/equipment_ql.aspx?sitemap= "Location: Lifecycle Management > Asset picking > Using department heads ' \ "}]}

2, the JSON format string in 1 is processed as a JSON object, you need to first remove the escape "\"
  
result = Stringescapeutils.unescapejava (result);                  New jsonobject (result);  Jsonobject.get ("Count");

  




Java handles escape slashes in JSON-formatted data

Related Article

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.