/*
Are you for real?
What\'s in a name?
Mc''Williams
<data>
<data>
*/
import org.apache.commons.lang.StringEscapeUtils;
public class StringUtilsEscapeExampleV1 {
public static void main(String args[]) {
String unescapedJava = "Are you for real?";
System.err.println(
StringEscapeUtils.escapeJava(unescapedJava));
String unescapedJavaScript = "What's in a name?";
System.err.println(
StringEscapeUtils.escapeJavaScript(unescapedJavaScript));
String unescapedSql = "Mc'Williams";
System.err.println(
StringEscapeUtils.escapeSql(unescapedSql));
String unescapedXML = "";
System.err.println(
StringEscapeUtils.escapeXml(unescapedXML));
String unescapedHTML = "";
System.err.println(
StringEscapeUtils.escapeHtml(unescapedHTML));
}
}
BeanUtilsStringUtilsEscapeExampleV1.zip( 1,005 k)