|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--allensoft.util.StringUtilities
A miscelaneous collection of useful string utility functions.
Constructor Summary | |
StringUtilities()
|
Method Summary | |
static boolean |
containsWhiteSpace(java.lang.String s)
|
static java.lang.String |
expandTabs(java.lang.String sString,
int nTabSize)
Expands the the suplied string and returns a new string where tabs have been expanded to spaces. |
static boolean |
matchesPattern(java.lang.String sString,
java.lang.String sPattern)
Determines if a string matches a pattern with case sensitivity. |
static boolean |
matchesPattern(java.lang.String sString,
java.lang.String sPattern,
boolean bCaseSensitive)
Determines if a string matches a pattern with or without case sensitivity. |
static java.lang.String |
padZeros(int length,
int value)
Creates a string from an integer value and pads it with zeros at the start to fill the supplied length. |
static java.lang.String |
padZeros(int length,
int value,
int base)
Creates a string from an integer value using the specified base and pads it with zeros at the start to fill the supplied length. |
static java.lang.String[] |
separateString(java.lang.String string)
Seapartes the string using a comma without trimming of the separted strings. |
static java.lang.String[] |
separateString(java.lang.String string,
boolean trim)
Seapartes the string using a comma with optional trimming of the separted strings. |
static java.lang.String[] |
separateString(java.lang.String string,
java.lang.String separator)
Separates the string using the supplied separator without trimming the separted strings. |
static java.lang.String[] |
separateString(java.lang.String string,
java.lang.String separator,
boolean trim)
Separates the supplied string into separate strings which are separated by the separator. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StringUtilities()
Method Detail |
public static java.lang.String padZeros(int length, int value, int base)
length
- the length of the returned string after padding with zerosvalue
- the value to be padded with zeros.base
- the base to use for the number when represented as a string.public static java.lang.String padZeros(int length, int value)
length
- the length of the returned string after padding with zerosvalue
- the value to be padded with zeros.public static java.lang.String[] separateString(java.lang.String string, java.lang.String separator, boolean trim)
string
- the string to be separatedseparator
- the string used as the separator (e.g. ",")trim
- true if white space should be trimmed from the separated strings or false if they shouldn'tpublic static boolean containsWhiteSpace(java.lang.String s)
public static java.lang.String[] separateString(java.lang.String string, java.lang.String separator)
public static java.lang.String[] separateString(java.lang.String string, boolean trim)
public static java.lang.String[] separateString(java.lang.String string)
public static boolean matchesPattern(java.lang.String sString, java.lang.String sPattern, boolean bCaseSensitive)
sString
- The string to match against the pattern.sPattern
- The pattern to check against.bCaseSensitive
- true if case sensitivity should be used when matching the pattern or false otherwise.public static boolean matchesPattern(java.lang.String sString, java.lang.String sPattern)
sString
- The string to match against the pattern.sPattern
- The pattern to check against.public static java.lang.String expandTabs(java.lang.String sString, int nTabSize)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |