src/main/java/org/jboss/util/Strings.java
/**
    * Returns a new string with all the whitespace removed
    * 
    * @param s the source string
    * @return the string without whitespace or null
    */
Returns a new string with all the whitespace removed

@param s the source string
@return the string without whitespace or null
Returns a new string with all the whitespace removed @param s the source string @return the string without whitespace or null
public static String removeWhiteSpace(String s)
   {
      String retn = null;
      if (s != null)
      {
         int len = s.length();
         StringBuffer sbuf = new StringBuffer(len);
         for (int i = 0; i < len; i++)
         {
            char c = s.charAt(i);
            if (!Character.isWhitespace(c))
                sbuf.append(c);
         }
         retn = sbuf.toString();
      }
      return retn;
   }
public static String removeWhiteSpace ( String s ) { String retn = null ; if ( s != null ) { int len = s . length ( ) ; StringBuffer sbuf = new StringBuffer ( len ) ; for ( int i = 0 ; i < len ; i ++ ) { char c = s . charAt ( i ) ; if ( ! Character . isWhitespace ( c ) ) sbuf . append ( c ) ; } retn = sbuf . toString ( ) ; } return retn ; }
Returns a new string with all the whitespace removed
Returns a new string with all the whitespace removed