Java examples for java.lang:String Replace
replace Mark from HTML String
//package com.java2s; public class Main { public static void main(String[] argv) { String content = "java2s.com"; System.out.println(replaceMark(content)); }/*from w w w . j av a2s . c om*/ public static String replaceMark(String content) { String strContent = ""; String strMark = "<\\s*[^>]*>"; strContent = content.trim(); strContent = strContent.replaceAll("\"", ""); strContent = strContent.replaceAll("\'", ""); //????<>?? strContent = strContent.replaceAll(strMark, ""); strContent = strContent.replaceAll(" ", ""); strContent = strContent.replaceAll(" ", ""); strContent = strContent.replaceAll("?", ""); strContent = strContent.replaceAll("\r", ""); strContent = strContent.replaceAll("\n", ""); strContent = strContent.replaceAll("\r\n", ""); return strContent; } }