All Packages Class Hierarchy This Package Previous Next Index
Class com.kvisco.xml.Whitespace
com.kvisco.xml.Whitespace
- public class Whitespace
A class for handling XML Whitespace
- Author:
- Keith Visco
-
CR
- Carriage Return character
Changed to '\r' instead of '
' to make compatible
with MS J++
Mohan Embar
-
EMPTY
- Empty String
-
LF
- Linefeed character
-
NULL
- Null character
-
SPACE
- Single space character
-
TAB
- Tab character
-
Whitespace()
-
-
stripSpace(String)
- Strips whitespace from the given String.
-
stripSpace(String, boolean, boolean)
- Strips whitespace from the given String.
NULL
public static final char NULL
- Null character
SPACE
public static final char SPACE
- Single space character
TAB
public static final char TAB
- Tab character
CR
public static final char CR
- Carriage Return character
Changed to '\r' instead of '
' to make compatible
with MS J++
Mohan Embar
LF
public static final char LF
- Linefeed character
EMPTY
public static final String EMPTY
- Empty String
Whitespace
public Whitespace()
stripSpace
public static String stripSpace(String data)
- Strips whitespace from the given String.
Newlines (#xD), tabs (#x9), and consecutive spaces (#x20) are
converted to a single space (#x20).
This method is useful for processing consective Strings since
any leading spaces will be converted to a single space.
- Parameters:
- data - the String to strip whitespace from
stripSpace
public static String stripSpace(String data,
boolean stripAllLeadSpace,
boolean stripAllTrailSpace)
- Strips whitespace from the given String.
Newlines (#xD), tabs (#x9), and consecutive spaces (#x20) are
converted to a single space (#x20).
- Parameters:
- data - the String to strip whitespace from
- stripAllLeadSpace, - a boolean indicating whether or not to
strip all leading space. If true all whitespace from the start of the
given String will be stripped. If false, all whitespace from the start
of the given String will be converted to a single space.
- stripAllTrailSpace, - a boolean indicating whether or not to
strip all trailing space. If true all whitespace at the end of the
given String will be stripped. If false, all whitespace at the end
of the given String will be converted to a single space.
All Packages Class Hierarchy This Package Previous Next Index