org.exolab.adaptx.xml
Class Whitespace
java.lang.Object
org.exolab.adaptx.xml.Whitespace
public class Whitespace
extends java.lang.Object
A class for handling XML Whitespace
- Keith Visco
static char | CR - Carriage Return character
Changed to '\r' instead of '\u000D' to make compatible
with MS J++
Mohan Embar
|
static String | EMPTY - Empty String
|
static char | LF - Linefeed character
|
static char | NULL - Null character
|
static char | SPACE - Single space character
|
static char | TAB - Tab character
|
static String | stripSpace(String data) - Strips whitespace from the given String.
|
static String | stripSpace(String data, boolean stripAllLeadSpace, boolean stripAllTrailSpace) - Strips whitespace from the given String.
|
static int | stripSpace(char[] data, boolean stripAllLeadSpace, boolean stripAllTrailSpace) - Strips whitespace from the given String.
|
CR
public static final char CR
Carriage Return character
Changed to '\r' instead of '\u000D' to make compatible
with MS J++
Mohan Embar
EMPTY
public static final String EMPTY
Empty String
LF
public static final char LF
Linefeed character
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
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.
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).
data
- the String to strip whitespace from
stripSpace
public static int stripSpace(char[] 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).
data
- the chars to strip whitespace from
- the new length of the array