|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.util.Strip
public class Strip
Class to strip characters from the beginning and end of strings.
Example1: Strip.Char("..dfld..",'.',Strip.TRAILING) yields "..dlfd."
Example2: Strip.Chars("..dfld..",".",Strip.TRAILING) yields "..dlfd"
Example3: Strip.Chars(". .. dfld. , .","., ",Strip.BOTH) yields "dfld"
| Field Summary | |
|---|---|
static int |
BOTH
Strip both, characters at begin and end of string are checked |
static int |
LEADING
Strip leading, only characters at begin of string are checked |
static int |
NOTHING
Strip nothing, a rather ineffecient form of a copy |
static int |
TRAILING
Strip trailing, only characters at end of string are checked |
| Method Summary | |
|---|---|
static String |
character(String str,
char chr,
int where)
Strip all of the specified character from beginning, end or both. |
static String |
chars(String str,
String chars,
int where)
Strip multiple characters contained in the set given as second parameter until a non-set character. |
static String |
doubleQuote(String str,
int where)
Strip double quotes from beginning, end or both, only once. |
static void |
main(String[] args)
Test the class |
static String |
singleQuote(String str,
int where)
Strip single quotes from beginning, end or both, only once. |
static String |
whitespace(String str,
int where)
Strip multiple whitespace characters from beginning, end or both, that means keep on stripping util a non-whitespace character is found. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NOTHING
public static final int LEADING
public static final int TRAILING
public static final int BOTH
| Method Detail |
|---|
public static String doubleQuote(String str,
int where)
str - the string to stripwhere - one of NOTHING, LEADING, TRAILING
or BOTH
public static String singleQuote(String str,
int where)
str - the string to stripwhere - one of NOTHING, LEADING, TRAILING
or BOTH
public static String whitespace(String str,
int where)
str - the string to stripwhere - one of NOTHING, LEADING, TRAILING
or BOTH
public static String character(String str,
char chr,
int where)
str - the string to stripchr - the character to strip from the stringwhere - one of NOTHING, LEADING, TRAILING
or BOTH
public static String chars(String str,
String chars,
int where)
str - the string to stripchars - a string containing all characters to strip from the stringwhere - one of NOTHING, LEADING, TRAILING
or BOTH
public static void main(String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||