List of usage examples for java.lang String replace
public String replace(CharSequence target, CharSequence replacement)
From source file:Main.java
public static String removeHtmlTags(String toCleanString) { toCleanString = toCleanString.replace("<html>", ""); toCleanString = toCleanString.replace("</html>", ""); toCleanString = toCleanString.replace("<head></head>", ""); toCleanString = toCleanString.replace("<body>", ""); toCleanString = toCleanString.replace("</body>", ""); return toCleanString.trim(); }
From source file:Main.java
/** * Converts a "simple" class name into a "binary" class name. For * example://from w w w . j ava2 s . co m * * SharedPreferences.Editor --> SharedPreferences$Editor * * Do not use this on fully-qualified class names. */ public static String simpleClassNameToBinary(String className) { return className.replace('.', '$'); }
From source file:Main.java
/** * @param str A String that will be inserted into XML. * @return The String with special characters escaped. *///from ww w . ja v a 2 s. co m public static String escapeSpecialCharacters(String str) { str = str.replace("&", "&"); // & must be replaced first str = str.replace("<", "<"); str = str.replace(">", ">"); str = str.replace("\"", """); return str; }
From source file:Main.java
public static String xmlEncode(String string) { return string.replace("&", "&").replace("'", "'").replace("\"", """).replace("<", "<") .replace(">", ">"); }
From source file:createbulksubdomainconfig.CreateBulkSubdomainConfig.java
protected synchronized static String getDbFileContent(String strDbUsrName, String strDbPwd, String strDbName) { // System.out.println(strDbUsrName+"\t"+strDbName+"\t"+strDbPwd); String strTemp = mDatabase; strTemp = strTemp.replace("{{db_user_name}}", strDbUsrName); strTemp = strTemp.replace("{{db_pwd}}", strDbPwd); return strTemp.replace("{{db_name}}", strDbName); }
From source file:Main.java
public static String convertClassToResourcePath(final String pName) { return pName.replace('.', '/') + ".class"; }
From source file:Main.java
public static String toPath(Context context) { String pn = getPackageName(context); pn = pn.replace("com.", ""); return pn.replace(".", "/"); }
From source file:Main.java
/** * Removes the CDATA protection of an XML String * /*from ww w . j a va 2s.com*/ * @param xml * @return the XML String without the CDATA protection */ public static String removeCData(String xml) { String cleanXML = xml.replace("<![CDATA[", ""); cleanXML = cleanXML.replace("]]>", ""); return cleanXML; }
From source file:Main.java
public static String sescape(String str) { try {//from w ww. ja va2 s .co m return str.replace("'", "_").replace("\"", "_").replace(":", "_").replace("+", "_").replace("?", "_") .replace("!", "_").replace("#", "_").replace("(", "_").replace(")", "_").replace("{", "_") .replace("}", "_").replace("\\", "_").replace("&", "_").replace("\n", "_").replace("|", "_") .replace("*", "_").replace("/", "_").replace(",", "_"); } catch (NullPointerException e) { return "unkown"; } }
From source file:org.bimserver.javamodelchecker.WriteToJson.java
private static String changeClassName(String code, String name) { return code.replace("public class " + name, "public class Implementation"); }