static public String filter7bits ( String s ) { if ( s == null ) return null ; char [ ] bo = new char [ s . length ( ) ] ; int count = 0 ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { char c = s . charAt ( i ) ; if ( ( c < 128 ) && ( c > 31 ) || ( ( c == ' ' ) || ( c == ' ' ) ) ) { bo [ count ++ ] = c ; } } return new String ( bo , 0 , count ) ; }
Remove all but printable ascii