List of usage examples for java.lang String replace
public String replace(CharSequence target, CharSequence replacement)
From source file:Main.java
public static String escape(String xml) { return xml.replace("&", "&").replace("<", "<").replace(">", ">").replace("'", "'") .replace("\"", """); }
From source file:Main.java
public static String unescapeQueryString(String qry) { qry = qry.replace("\\\"", "\""); qry = qry.replace("\\'", "'"); return qry;/*from w w w.java2s . c o m*/ }
From source file:Main.java
public static String htmlToText(String str) { str = str.replace("<br />", "\n"); str = str.replace("<br/>", "\n"); str = str.replace(" ", "\t"); str = str.replace(" ", " "); str = str.replace("'", "\\"); str = str.replace(""", "\\"); str = str.replace(">", ">"); str = str.replace("<", "<"); str = str.replace("&", "&"); return str;// w ww . j a va 2s.c o m }
From source file:Main.java
public static String HtmlToText(String str) { str = str.replace("<br />", "\n"); str = str.replace("<br/>", "\n"); str = str.replace(" ", "\t"); str = str.replace(" ", " "); str = str.replace("'", "\\"); str = str.replace(""", "\""); str = str.replace(">", ">"); str = str.replace("<", "<"); str = str.replace("&", "&"); return str;//w w w . j a v a2 s.c o m }
From source file:Main.java
private static String base64UrlToBase64(String base64Url) { return base64Url.replace('-', '+').replace('_', '/'); }
From source file:Main.java
/** * Fix for carriage returns displayed as rectangle characters in Android 1.6 * @param str// www . ja va2s . c om * @return */ public static String removeCarriageReturns(String str) { return str.replace("\r", ""); }
From source file:Main.java
public static int teamNumberFromTeamKey(String teamKey) { return Integer.parseInt(teamKey.replace("frc", "")); }
From source file:Main.java
public static String getFunctionFromReturnUrl(String url) { String temp = url.replace(YY_RETURN_DATA, EMPTY_STR); String[] fuctionAndData = temp.split(SPLIT_MARK); if (fuctionAndData != null && fuctionAndData.length >= 1) { return fuctionAndData[0]; }/*from w w w. j a v a 2 s. c o m*/ return null; }
From source file:Main.java
public static String getDataFromReturnUrl(String url) { String temp = url.replace(YY_RETURN_DATA, EMPTY_STR); String[] fuctionAndData = temp.split(SPLIT_MARK); if (fuctionAndData != null && fuctionAndData.length >= 2) { return fuctionAndData[1]; }// www . jav a 2s .c o m return null; }
From source file:Main.java
public static String devideNumToStr(String srcStr, String newSplit) { return srcStr.replace(SPILCT, newSplit); }