replace Multiple Whitespace in a string - Android java.util.regex

Android examples for java.util.regex:IP Address Pattern

Description

replace Multiple Whitespace in a string

Demo Code

import java.util.Arrays;

public class Main{

    public static String replaceMultipleWhitespace(String original) {
        return original.replaceAll("(\\s)+", " ");
    }/*  w  w w.ja  v  a 2s . co  m*/

}

Related Tutorials