Java String Whitespace Normalize normalizeWhiteSpace(String input)

Here you can find the source of normalizeWhiteSpace(String input)

Description

normalize White Space

License

LGPL

Declaration

public static String normalizeWhiteSpace(String input) 

Method Source Code

//package com.java2s;
//License from project: LGPL 

public class Main {
    public static String normalizeWhiteSpace(String input) {
        return input.replaceAll("\\s+", " ").replaceAll("([^\\w])\\s+", "$1");
    }/*from w  w  w  .  ja va 2  s .  co m*/
}

Related

  1. normaliseWhitespace(String string)
  2. normalizeIndentationFromWhitespace(String str, int tabSize, boolean insertSpaces)
  3. normalizeWhitespace(final String str)
  4. normalizeWhitespace(String dirtyString)
  5. normalizeWhiteSpace(String input)
  6. normalizeWhitespace(String orig)
  7. normalizeWhitespace(String s)
  8. normalizeWhitespace(String source)
  9. normalizeWhiteSpace(String src)