List of usage examples for java.lang String replaceAll
public String replaceAll(String regex, String replacement)
From source file:Main.java
/** * if the search string in HQL has the "'", when call the hibernate search method, * will get error. so must replace the "'" to "''", it will work. *//*from w w w . j av a 2 s.c o m*/ public static String FixTermIllegalChar(String term) { term = term.replaceAll("'", "''"); return term; }
From source file:Main.java
/** * removing comma and parse into 'double' * @param String value// w w w .j ava 2 s . co m * @return Integer */ public static double removeDoubleComma(String value) { return Double.parseDouble(value.replaceAll(",", "")); }
From source file:Main.java
public static String unformatNumOrZero(String num) { try {//w ww . j a v a 2s . com num = num.replaceAll(",", ""); } catch (Exception e) { return "0"; } return num; }
From source file:Main.java
public static String htmlDecode(String htmlStr) { String str = htmlStr; str = str.replaceAll("&", "&"); str = str.replaceAll("'", "'"); str = str.replaceAll("'", "'"); str = str.replaceAll(""", "\""); str = str.replaceAll("<", "<"); str = str.replaceAll(">", ">"); return str;//w w w . ja v a2s . c o m }
From source file:Main.java
public static String escape(String target) { String escape = target; escape = escape.replaceAll("&", "&"); escape = escape.replaceAll(">", ">"); escape = escape.replaceAll("<", "<"); escape = escape.replaceAll("\"", """); escape = escape.replaceAll("'", "'"); return escape; }
From source file:Main.java
private static String unesc(String str) { return str.replaceAll("&&&", ":").replaceAll("&!&", "[").replaceAll("!&!", "]").replaceAll("!!!", ",") .replaceAll("!!&", "{").replaceAll("&&!", "}").replaceAll("###", "@"); }
From source file:Main.java
public static String splitCamelCase(String s) { return s.replaceAll(String.format("%s|%s|%s", "(?<=[A-Z])(?=[A-Z][a-z])", "(?<=[^A-Z])(?=[A-Z])", "(?<=[A-Za-z])(?=[^A-Za-z])"), " "); }
From source file:Main.java
public static String constructFileName(String url) { return url.replaceAll("/", "_"); }
From source file:Main.java
public static String escape(String input) { return input.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll("\"", """); }
From source file:Main.java
public static String reeplazarBackSlash(String ruta) { try {/*from w w w . ja v a 2s . c om*/ return ruta.replaceAll("\\\\", "/"); } catch (Exception exc) { return ruta; } }