Java String Whitespace Collapse collapseWhiteSpace(final String s)

Here you can find the source of collapseWhiteSpace(final String s)

Description

collapse White Space

License

Open Source License

Declaration

final public static String collapseWhiteSpace(final String s) 

Method Source Code

//package com.java2s;
// License as published by the Free Software Foundation; either

public class Main {
    final public static String collapseWhiteSpace(final String s) {
        return s.replaceAll("[\\s]+", " ");
    }//w  w  w . j  a  v a 2s .c o  m
}

Related

  1. collapseSpaces(String argStr)
  2. collapseSpaces(String s)
  3. collapseSpaces(String text, char[] spaceCharacters)
  4. collapseWhiteSpace(CharSequence value)
  5. collapseWhiteSpace(String content)
  6. collapseWhitespace(String in, char replacementChar)
  7. collapseWhitespace(String s)
  8. collapseWhitespace(String s, boolean trim)