|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.brains2b.util.StringHelper
Some static functions that help with Stringmanipulation.
Constructor Summary | |
protected |
StringHelper()
Creates new StringHelper, protected as all functions are static |
Method Summary | |
static java.lang.String |
baseOnly(java.lang.String str)
Returns only the base capitilazid characters [A-Z][0-9] All other characters are removed from the String |
static java.lang.String |
breakLine(java.lang.String str,
int maxLen)
Breaks a String after a maximun number of characters on the first space or punctuation before that maximum. |
static int |
getNonBaseCharacter(java.lang.String value)
|
static int |
getNonBaseCharacter(java.lang.String value,
int start)
|
static java.lang.String |
initCaps(java.lang.String str,
char c)
Capitalize the first Letter in a String and all letters following the char. |
static boolean |
isEmpty(java.lang.String s)
check if a String is empty, meaning a String of length zero or null |
static boolean |
isQuoteCharacter(char a)
check is a character is a quote: "e; or & |
static java.lang.String |
leftPad(java.lang.String str,
java.lang.String filler,
int len)
Pads a String to the left with th filler String until len is reached If the String is longer then the length the string will be truncated on the left to not return more then lenght characters |
static int |
matchBracket(char left,
java.lang.String line)
Finds the matching bracket for the first character given by left in String line. |
static int |
matchBracket(int pos,
java.lang.String line)
Finds the matching bracket for the bracket character at pos in line. |
static java.lang.String |
rightPad(java.lang.String str,
java.lang.String filler,
int len)
Pads a String to the right with the filler String until len is reached If the String is longer then the length the string will be truncated on the right to not return more then lenght characters |
static java.lang.String |
stripper(java.lang.String str,
char c)
Strips a character from a String. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected StringHelper()
Method Detail |
public static java.lang.String initCaps(java.lang.String str, char c)
str
- String, the String that needs to be InitCapped.c
- char, The character after which letters should be capitalized
public static java.lang.String stripper(java.lang.String str, char c)
str
- String, from which the character should be
removedc
- char, the Character that needs to be removd
public static int getNonBaseCharacter(java.lang.String value)
public static int getNonBaseCharacter(java.lang.String value, int start)
public static java.lang.String baseOnly(java.lang.String str)
str
- String, the value to be 'based'
public static final java.lang.String breakLine(java.lang.String str, int maxLen)
public static java.lang.String leftPad(java.lang.String str, java.lang.String filler, int len)
str
- String, if str is null, it will be threated as a zero length stringfiller
- String, the String that fills the original String on the left until length.len
- int, the length of the output string
java.lang.NullPointerException
- thrown if filler is nullpublic static java.lang.String rightPad(java.lang.String str, java.lang.String filler, int len)
str
- String, if str is null, it will be threated as a zero length stringfiller
- String, the String that fills the original String on the left until lengthlen
- int, the length of the output string
java.lang.NullPointerException
- thrown if filler is nullpublic static int matchBracket(char left, java.lang.String line)
left
- char, the bracket character ",',{,[,( one is looking forline
- String, the line to find the matching bracket in
matchBracket(int, String)
public static int matchBracket(int pos, java.lang.String line)
pos
- int, The position of the matching bracket, valid
brackets are ",',{,[,( line
- String, the line to find the matching bracket in
public static boolean isQuoteCharacter(char a)
a
- char, the char to test
public static boolean isEmpty(java.lang.String s)
s
- String, to test for empty
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |