|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.equanda.util.StringUtil
public final class StringUtil
string utility methods - format : build formatted strings, using the format descriptors as used by sprintf, but without the % - isNum : determine if a string contains only digits - trimRight
Method Summary | |
---|---|
static String |
addPrefix(String format,
String str)
|
static String |
digitsOnly(String str)
Convert given string into a string which only contains the digits |
static String |
format(double value,
String format)
|
static String |
format(int value,
String format)
|
static String |
format(long value,
String format)
|
static String |
format(Object value,
String format)
|
static String |
getLine(String str,
int pos)
Extract line with given number from the string, lines are separated by newlines. |
static String |
increment(String base)
Given a string, increment the digits at the end with one |
static boolean |
isEmpty(String str)
True when string is null or empty. |
static boolean |
isNum(String s)
|
static String |
left(String base,
int length)
Return first x characters from a string, or less if string is not long enough |
static String |
nospace(String str)
Convert given string into a string which does not contain any of the whitespace (left/right and middle). |
static boolean |
objectEquals(Object obj1,
Object obj2)
|
static String |
replace(String base,
String what,
String with)
In a string, replace all occurences of one string with another. |
static String |
right(String base,
int length)
Return last x characters from a string, or less if string is not long enough |
static String |
toCapitalizedCase(String str)
Assure the passed string is all lower case exceptio for the first character which is upper case. |
static String |
trimRight(String s)
Removes white space (all ASCII control characters) from the right end of a string. |
static String |
wordwrap(String base,
int linelen,
int line)
Apply wordwrap to the given string, for given line length, and return the line requested. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static String format(Object value, String format)
public static String format(int value, String format)
public static String format(long value, String format)
public static String format(double value, String format)
public static boolean isNum(String s)
public static String trimRight(String s)
s
- input string
public static String replace(String base, String what, String with)
base
- String to replace substrings in.what
- String to be found and replaced.with
- String to replaces occurences with.
public static String wordwrap(String base, int linelen, int line)
base
- String which needs wordwraplinelen
- Line length to be used when wrappingline
- line which is requested
public static String digitsOnly(String str)
str
- input string
public static String nospace(String str)
str
- input string
public static String getLine(String str, int pos)
str
- input stringpos
- position
public static String addPrefix(String format, String str)
public static String increment(String base)
base
- input string
public static boolean objectEquals(Object obj1, Object obj2)
public static String left(String base, int length)
base
- base stringlength
- mas number of characters to return
public static String right(String base, int length)
base
- base stringlength
- mas number of characters to return
public static boolean isEmpty(String str)
str
- string to test
public static String toCapitalizedCase(String str)
str
- string to convert
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |