|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--SSF.OS.BGP4.Util.StringManip
This class contains public utility methods useful for manipulating character strings.
| Constructor Summary | |
StringManip()
|
|
| Method Summary | |
static java.lang.String |
pad(java.lang.String str)
Pads a string by adding characters to it. |
static java.lang.String |
pad(java.lang.String str,
int places)
Pads a string by adding characters to it. |
static java.lang.String |
pad(java.lang.String str,
int places,
char ch)
Pads a string by adding characters to it. |
static java.lang.String |
pad(java.lang.String str,
int places,
char ch,
boolean atend)
Pads a string by adding characters to it. |
static java.lang.String |
repeat(char ch,
int len)
Creates a string of arbitrary length by repeating just one character. |
static java.lang.String |
repeat(char ch,
int len,
int min)
Creates a string of arbitrary length by repeating just one character. |
static java.lang.String |
unpad(java.lang.String str)
Removes "padding" characters from a string. |
static java.lang.String |
unpad(java.lang.String str,
char ch)
Removes "padding" characters from a string. |
static java.lang.String |
unpad(java.lang.String str,
char ch,
boolean atend)
Removes "padding" characters from a string. |
static java.lang.String |
unpad(java.lang.String str,
char ch,
boolean atend,
int minplaces)
Removes "padding" characters from a string. |
static java.lang.String |
ws(int len)
Creates a string of whitespace composed of space characters only. |
static java.lang.String |
ws(int len,
int min)
Creates a string of whitespace composed of space characters only. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public StringManip()
| Method Detail |
public static final java.lang.String repeat(char ch,
int len,
int min)
ch - The character to use for the string.len - The length (in characters) of the string to be created.
A negative value will be treated as a 0.min - The minimum length (in characters) of the string to be
created. This may seem odd since length is specified, but
it is useful sometimes when an expression with unknown
value is provided for the length.
public static final java.lang.String repeat(char ch,
int len)
ch - The character to use for the string.len - The length (in characters) of the string to be created.
A non-positive value is be treated as a 1.
public static final java.lang.String ws(int len,
int min)
len - The length (in characters) of the whitespace to be created.
A negative value will be treated as a 0.min - The minimum length (in characters) of the whitespace to
be created.
public static final java.lang.String ws(int len)
len - The length (in characters) of the whitespace to be created.
A non-positive value is treated as a 1.
public static final java.lang.String pad(java.lang.String str,
int places,
char ch,
boolean atend)
str - The string to pad.places - The maximum length of the string to pad up to.ch - The character to pad with.atend - Whether to pad at the end or the beginning of the string.
public static final java.lang.String pad(java.lang.String str,
int places,
char ch)
str - The string to pad.places - The maximum length of the string to pad up to.ch - The character to pad with.
public static final java.lang.String pad(java.lang.String str,
int places)
str - The string to pad.places - The maximum length of the string to pad up to.
public static final java.lang.String pad(java.lang.String str)
str - The string to pad.
public static final java.lang.String unpad(java.lang.String str,
char ch,
boolean atend,
int minplaces)
pad.
str - The string to unpad.ch - The character used as padding.atend - Whether to unpad at the end or beginning of the string.minplaces - The minimum number of characters to leave in the string
after unpadding.
public static final java.lang.String unpad(java.lang.String str,
char ch,
boolean atend)
pad.
str - The string to unpad.ch - The character used as padding.atend - Whether to unpad at the end or beginning of the string.
public static final java.lang.String unpad(java.lang.String str,
char ch)
pad.
str - The string to unpad.ch - The character used as padding.
public static final java.lang.String unpad(java.lang.String str)
pad.
str - The string to unpad.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||