Here you can find the source of JsonEscape(String str)
public static String JsonEscape(String str)
//package com.java2s; //License from project: Open Source License public class Main { public static String JsonEscape(String str) { return EscapeForHtml(str).replace("\\", "\\\\"); }/*from w w w . jav a 2s . c o m*/ public static String EscapeForHtml(String str) { str = str.replaceAll("'", "'"); str = str.replaceAll("\"", """); str = str.replaceAll("<", "<"); str = str.replaceAll(">", ">"); str = str.replaceAll("\\\\n", "<br>"); return str; } }