This class defines new trimAndCollapseWhitespace() methods which appear on String
and GString classes inside the Groovy environment. Static methods are used with the first
parameter being the destination class, i.e. public static String
trimAndCollapseWhitespace(String self) provides a trimAndCollapseWhitespace() method for
String.
NOTE: While this class contains many 'public' static methods, it is intended as an internal class and should not be referenced directly. Future versions may move methods in this class to another internal class, but aim to keep the methods available from within Groovy.
| Type | Name and description |
|---|---|
static String |
trimAndCollapseWhitespace(String self)Trims leading and trailing whitespace and collapses multiple whitespace characters to one single space. |
static GString |
trimAndCollapseWhitespace(GString self)Trims leading and trailing whitespace and collapses multiple whitespace characters to one single space. |
Trims leading and trailing whitespace and collapses multiple whitespace characters to one
single space. This use the Java Pattern definition of "whitespace", (i.e. matches the
\s predefined character class).
Stringself - a String Trims leading and trailing whitespace and collapses multiple whitespace characters to one
single space. This use the Java Pattern definition of "whitespace", (i.e. matches the
\s predefined character class). This does not modify the given GString, nor
does it modify the GString's embedded values.
GStringself - a GString