「Java」文字列のエスケープ処理コード

Javaコード:
public static String escape(String target) {
if (target == null) {
return “";
}
String afterEscape = target.replace(“&", “&amp;").replace(“\"", “&quot;").replace(“<“, “&lt;")
.replace(“>", “&gt;").replace(“'", “&#39;");
return afterEscape;
}
}

Java

Posted by arkgame