json android中未终止的对象字符

时间:2014-12-13 20:55:09

标签: android json

我尝试从json中替换转义序列和特殊字符,但似乎没有任何效果,

String reString=stringresponce.replaceAll("<", "").replaceAll("!", "").replaceAll("-", "").replaceAll("/", "").replaceAll(">", "").replaceAll("#", "").replaceAll("/\r", "").replaceAll("/\n", "").replaceAll("/\r/\n", "").replaceAll("/\r/\n", "");



  org.json.JSONException: Unterminated object at character 325 of 
[{"business_id":17,"business_name":"SOMALI EDUCATION RESOURCE CENTER","business_address":"4337 Cleveland Avenue, Columbus, OH 43224, USA","business_google_long":"82.95385742","business_google_lat":"40.05750275","contact_no":"614 525 9083","contact_no2":null,"contact_no3":null,"business_website":"http:\\www.serc360.com\","sub_category_id":"25","category_id":"12","date_created":"20141127 14:24:45","business_description":"The mission of the Somali Education and Resource Center is to provide skills and literacy by expanding the knowledge of immigrants and refugees by teaching them the financial social and cultural skills that provide a foundation to attain selfsufficiency. We also offer the following services.\r\n\r\nFamily Literacy\r\nAfterSchool Program Activities\r\nYouth Training\r\nFinancial Literacy","subscriber_id":"23","images":[{"image_name":"bi\1417123343010serc1.png"},{"image_name":"bi\1417123433298serc4.jpg"},{"image_name":"bi\1417123485124serc2.JPG"}],"rating":"4","reviews":[],"business_hours":[{"bh_day":"Saturday","bh_start":"09:00 AM","bh_end":"5:00 PM"},{"bh_day":"Sunday","bh_start":"09:00 AM","bh_end":"5:00 PM"},{"bh_day":"Monday","bh_start":"09:00 AM","bh_end":"5:00 PM"},{"bh_day":"Tuesday","bh_start":"09:00 AM","bh_end":"5:00 PM"},{"bh_day":"Wednesday","bh_start":"09:00 AM","bh_end":"5:00 PM"},{"bh_day":"Thursday","bh_start":"09:00 AM","bh_end":"5:00 PM"},{"bh_day":"Friday","bh_start":"09:00 AM","bh_end":"5:00 PM"}],"prayerTimings":[]},{"business_id":18,"business_name":"SOMALI COMMUNITY RESETTLEMENT SERVICES INC","business_address":"2593 South Ferris Park Drive, Columbus, OH 43224, USA","business_google_long":"82.95046997","business_google_lat":"40.08499146","contact_no":" (507) 7210641","contact_no2":null,"contact_no3":null,"business_website":"http:\\somalcrs.wix.com\scrs","sub_category_id":"25","category_id":"12","date_created":"20141127 14:37:02","business_description":"SCRS Mission\r\n \r\nTo promote and advance the social well being and the welfare of its members by providing muchneeded community and resettlement services with ultimate goal of building vibrant community whose members can successfully settle and effectively integrate into the wider American Community. ","subscriber_id":"24","images":[],"rating":"4","reviews":[],"business_hours":[{"bh_day":"Saturday","bh_start":"12:00 PM","bh_end":"12:00 PM"},{"bh_day":"Sunday","bh_start":"12:00 PM","bh_end":"12:00 PM"},{"bh_day":"Monday","bh_start":"12:00 PM","bh_end":"12:00 PM"},{"bh_day":"Tuesday","bh_start":"12:00 PM","bh_end":"12:00 PM"},{"bh_day":"Wednesday","bh_start":"12:00 PM","bh_end":"12:00 PM"},{"bh_day":"Thursday","bh_start":"12:00 PM","bh_end":"12:00 PM"},{"bh_day":"Friday","bh_start":"12:00 PM","bh_end":"12:00 PM"}],"prayerTimings":[]}]

1 个答案:

答案 0 :(得分:0)

我认为问题是:“http:\\ www.serc360.com \”
通常黑色斜杠用于转义字符,所以最后一个\会破坏你的字符串,通常,http地址格式如下:http://,而不是http:\\
希望它有所帮助!