Here you can find the source of sanitizeString(String s)
public static String sanitizeString(String s)
//package com.java2s; public class Main { public static String sanitizeString(String s) { StringBuilder sb = new StringBuilder(); for (char c : s.toCharArray()) { if (c < 0x20) { sb.append(" "); } else { sb.append(c);// w w w. j a v a2s. c om } } return sb.toString().trim(); } }