Here you can find the source of replaceBlank(String str)
Parameter | Description |
---|---|
str | a parameter |
public static String replaceBlank(String str)
//package com.java2s; //License from project: Apache License import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { /**/*from w w w.ja va2 s . c o m*/ * Filter the space tab etc... * * @param str * @return */ public static String replaceBlank(String str) { Pattern p = Pattern.compile("\\s*|\t|\r|\n"); Matcher m = p.matcher(str); return m.replaceAll(""); } }