Here you can find the source of quotEncode(String txt)
public static String quotEncode(String txt)
//package com.java2s; //License from project: Apache License public class Main { public static String quotEncode(String txt) { if ((txt == null) || (txt.length() == 0)) { return txt; }/*from www . j a va 2s .co m*/ txt = replace(txt, "&", "&"); txt = replace(txt, "\"", """); return txt; } public static String replace(String str, String subStr, String reStr) { if (str == null) { return null; } if ((subStr == null) || (subStr.equals("")) || (reStr == null)) { return str; } return str.replace(subStr, reStr); } }