Home > Java > javaTutorial > jQuery jqgrid's Java processing method for json data containing special characters

jQuery jqgrid's Java processing method for json data containing special characters

高洛峰
Release: 2017-01-19 15:19:20
Original
1549 people have browsed it

I have seen that many online processing of json data containing special characters determine which special characters they are one by one, such as how to handle carriage returns and how to handle quotation marks. In fact, there is a ready-made code library that can do this. Download json-lib-2.3-jdk15.jar:

import net.sf.json.util.JSONUtils; 

String str = (String) value; 
String s1 = JSONUtils.quote(str);//首尾带引号 
String s3 = JSONUtils.stripQuotes(s1);//去首位引号 
return s3;
Copy after login

This code is very concise.

For more jQuery jqgrid Java processing methods for json data containing special characters, please pay attention to the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template