Android String Merge combineBlank(String str)

Here you can find the source of combineBlank(String str)

Description

combine Blank

Declaration

public static String combineBlank(String str) 

Method Source Code

//package com.java2s;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {

    public static String combineBlank(String str) {
        String dest = str;/*from  w  w  w  .j a va 2s .c om*/
        if (str != null) {
            Pattern p = Pattern.compile("\t");
            Matcher m = p.matcher(str);
            dest = (m.replaceAll(" ")).trim().replaceAll(" +", " ");
        } else {
            dest = "";
        }
        return dest;
    }
}

Related

  1. mergeBlank(String s)