replace Control Chars in a string - Android java.util.regex

Android examples for java.util.regex:Blank Remove

Description

replace Control Chars in a string

Demo Code

import java.util.Arrays;

public class Main{

    public static String replaceControlChars(String original) {
        return original.replaceAll("[\\a\\e\\f\\n\\r\\t]", " ");
    }/*from  w  w w.  j a v  a2  s. c  o  m*/

}

Related Tutorials