List of usage examples for java.lang String replaceAll
public String replaceAll(String regex, String replacement)
From source file:Main.java
public static String cleanTorrentName(String torrentName) { return torrentName.replaceAll("[_\\.\\-\\|]", " ").replaceAll("( +)", " ").replaceAll("[^a-zA-Z0-9 ]", ""); }
From source file:Main.java
/** * replaceSpace in the url// w w w .ja va2s.c om * * @param url * @return */ public static String replaceSpace(String url) { return url.replaceAll(" ", "%20"); }
From source file:Main.java
public static String getFilenameFromBSSID(final String BSSID) { return BSSID.replaceAll(":", "_"); }
From source file:Main.java
/** * Escape XML// w ww. j a v a2s.co m * @param str The string * @return The string as valid XML */ public static String escapeXML(String str) { return str.replaceAll("\"", """).replaceAll("&", "&").replaceAll("<", "<") .replaceAll(">", ">").replaceAll("'", "'"); }
From source file:Main.java
private static String flattenXML(String s) { String flatS = s.replaceAll("> *<([^/])", "><$1").replaceAll("\n", ""); return flatS; }
From source file:Main.java
public static String escapeUnescapedCharacters(String str) { String txt = str.replaceAll("&", "&"); return txt;//w w w .j av a2s.c o m }
From source file:Main.java
/** * Converts the ampersand, quote, prime, less-than and greater-than * characters to their corresponding HTML entities in the given string. *//* www . j ava 2 s . c o m*/ public static String htmlEntities(String text) { return text.replaceAll("&", "&").replaceAll("\"", """).replaceAll("'", "′") .replaceAll("<", "<").replaceAll(">", ">"); }
From source file:Main.java
private static String colonize(String orig) { return orig.replaceAll("(?<=..)(..)", ":$1"); }
From source file:Main.java
/** * Return Primary Account Number with a space between each digit group. * * @param pan String//www . ja va 2s . c o m * @return String */ public static String prettyPan(String pan) { return pan.replaceAll("(.{4}(?!$))", "$1 ").trim(); }
From source file:Main.java
public static String entify(String s) { s = s.replaceAll("<", "<"); s = s.replaceAll(">", ">"); s = s.replaceAll("&", "&"); return s;//from w w w .ja va2 s .c o m }