「Java」XMLのエスケープ文字列をメタ文字に変換するコード

Javaコード
public static String Escape2MetaStr(String str) {
String cftResult = “";
cftResult = str.replace(“&amp", “&");
cftResult = cftResult.replace(“&lt", “<“);
cftResult = cftResult.replace(“&gt", “>");
cftResult = cftResult.replace(“&quot", “\"");
cftResult = cftResult.replace(“&#039", “\'");

return cftResult;
}

Java

Posted by arkgame