Example usage for java.lang String replaceAll

List of usage examples for java.lang String replaceAll

Introduction

In this page you can find the example usage for java.lang String replaceAll.

Prototype

public String replaceAll(String regex, String replacement) 

Source Link

Document

Replaces each substring of this string that matches the given regular expression with the given replacement.

Usage

From source file:Main.java

private static String normalize(String s) {
    return s.replaceAll("\\s+", " ");
}

From source file:Main.java

public static String removeSpacesFromUrl(String url) {

    url = url.replaceAll(" ", "%20");
    return url;/*www  .  ja  v  a 2s.  c o m*/
}

From source file:Main.java

public static String removeNumberSpace(String number) {
    return number.replaceAll(" ", "");
}

From source file:Main.java

public static String getString(String content) {
    return content.replaceAll(" ", "  ");
}

From source file:Main.java

public static boolean rightString(String s) {
    if (s.replaceAll("^[A-Za-z0-9\u4e00-\u9fa5]+$", "").length() == 0) {
        return true;
    } else {/*from   www . ja va  2 s . c o  m*/
        System.out.println("input incorrect");
        return false;
    }
}

From source file:Main.java

public static String getCleanFilename(String filename) {
    return filename.replaceAll("[?:\\/*\"<>|]", "c");
}

From source file:Main.java

public static String removeAllSpacesAtEnd(String theString) {
    return theString.replaceAll("\\s+$", "");
}

From source file:Main.java

public static String removeNewLines(String input) {
    input = input.replaceAll("\n", " ");
    return input;
}

From source file:Main.java

public static String cleanHtmlTag(String content) {
    return content.replaceAll(RE_HTML_MARK, "");
}

From source file:Main.java

public static String removeFuncInPaths(String original) {
    return original.replaceAll("/[a-z,A-Z]*\\:?[a-z,A-Z]+\\-?[a-z,A-Z]+\\(([^)]+)[\\)]{1}", "/$1");
}