Here you can find the source of cleanWhiteSpace(String s, boolean all)
public static String cleanWhiteSpace(String s, boolean all)
//package com.java2s; public class Main { public static String cleanWhiteSpace(String s, boolean all) { if (s == null) { return null; }/*from w ww. ja v a 2s.c o m*/ s = s.trim(); if (all) { s = s.replaceAll("\\s+", ""); } return s; } public static String cleanWhiteSpace(String s) { return cleanWhiteSpace(s, true); } }