The substring (3) the use of the http://www.w3school.com.cn/jsref/jsref_substring.asp
Possibility 1: if sb is the data to be converted, let’s say sb is a String
code>
The char code>
The STR [] = sb. ToString (). ToCharArray ();
code>
for
(
The int code>
i=
0
; i< str.length; i++){
code>
System.out.println(str[i]);
code>
}
After can get into an array of form, check the array before any Spaces, such as if useful
sb.toString().trim().substring(
1
); Cut off
code>
The String json = sb. ToString (). The trim (). The substring ( code>
1
);
code>
The // String json = "{\" success \ ": true, \" MSG \ ": \ \" successful "} ";
code>
System.out.println(json);
code>
System.out.println(json.length());
code>
The JSONObject JSONObject = JSONObject. FromObject (json. The trim ());
code>
System.out.println(jsonobject);
The code>
"Result" : [{}] ------ left less {
Possibility 2: No initialization, no initBmob () is likely to report this wrong Unregistered
Possibility 3: There is an extra space before the data in the database
Reproduced in: https://www.cnblogs.com/wth21-1314/p/7381575.html
Read More:
- 209151; org.json.JSONException A JSONObject text must begin with'{‘at character 1 of {
- Jsoneexception: a jsonobject text must begin with ‘{at character 0
- XMIND save error “a jsonobject text must begin with ‘{at 1 [character 2 Line 1]” solution
- Unable to read workspace file ‘D:\angular.json‘: Invalid JSON character: “ “ at
- Error reading JSON file: json.decoder.JSONDecodeError : Extra data: line 6 column 2 (char 1329)
- 【ipfs-api】npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.
- Postman returns to the data window and displays the JSON format by default
- A solution to automatically convert special characters into Unicode when taking out data from MySQL and encapsulating it into JSON
- Python’s json.loads Invalid control character
- [jQuery] jQuery operates on JSON strings or JSON objects
- Docker command error during connect: get http://2F2F.2Fpipe2Fdocker_ engine/v1.36/containers/json: open//.
- Notepad + + install JSON format plug-in
- When websocket transmits JSON text, the parse method reports an error
- R reads JSON data
- Storing JSON data in session storage
- Python json.dumps () json.dump The difference between ()
- Configuration file for vscode setting.json UI interface or JSON form
- JS error: unexpected token u in JSON at position 0
- JSON parse e rror: Invalid UTF-8 middle byte 0x3f;
- java.lang.NoSuchMethodError: org.json.JSONObject.put(Java/lang/String; Java/util/Collection;) “209151;”