List of usage examples for java.lang String replaceAll
public String replaceAll(String regex, String replacement)
From source file:Main.java
public static String ConvertOnlyNumerical(String input) { String output = input.replaceAll("[^0-9]", ""); //String output=input.replaceAll("^[^0-9]+$", ""); return output; }
From source file:Main.java
public static String getSimpleUrl(String url) { String simpleUrl = url.replaceAll("\\?.*", ""); return simpleUrl; }
From source file:Main.java
/** * Fix html currency symbols to the unicode equivalent * /*from w ww.j a v a 2s . c o m*/ * @param string * @return */ public static String currencyFix(final String string) { return string.replaceAll("£", "\u00A3").replaceAll("€", "\u20AC"); }
From source file:Main.java
public static String fixForUserInput(String str) { str = str.replaceAll("\\@<B>", "<B>@"); return str;//from www.j a v a2s. c o m }
From source file:Main.java
private static String trimVersion(String s) { return s.replaceAll("[^0-9.]", ""); }
From source file:Main.java
public static String toXPathExper(String simplePath) { simplePath = simplePath.replaceAll("/([^/]+)", "/\\*[local-name()='$1']"); simplePath = simplePath.replaceAll("^/", "//"); return simplePath; }
From source file:Main.java
/** * adds a tab to every line/*w w w. j av a 2s .c o m*/ * * @param text * @return */ public static String addTab(String text) { return text.replaceAll("\n", "\n\t"); }
From source file:Main.java
/** * So hacky I don't want to think about it. * //w ww . j a v a 2s . c o m * Takes in the xml text (as a string), * looks for a specific phrase ("xmlnsCHANGEME") and modifies * it such that it looks right when it comes time to displaying it * * * @param namespaceURI * @return */ public static String setDataNodeXMLNS(String xmlString) { return xmlString.replaceAll("xmlnsCHANGEME", "xmlns"); }
From source file:Main.java
public static String formatContent(String content) { content = content.replaceAll("&([^#])", "&$1"); content = content.replaceAll("<", "<"); content = content.replaceAll(">", ">"); content = content.replaceAll("\"", """); content = content.replaceAll("'", "'"); return content; }
From source file:Main.java
public static String entitizeContent(String xml) { return xml.replaceAll("&", "&").replaceAll("\"", """).replaceAll("'", "'"); }