Java tutorial
//package com.java2s; //License from project: Apache License public class Main { public static String formatContent(String content) { content = content.replaceAll("&([^#])", "&$1"); content = content.replaceAll("<", "<"); content = content.replaceAll(">", ">"); content = content.replaceAll("\"", """); content = content.replaceAll("'", "'"); return content; } }