|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.sas.edir.util.StringOp
String operator utilities History: 02Aug96 Created [bdw] 13Aug96 Add split with escape character [bdw] 10Apr97 Added equals() and equalsIgnoreCase() [djc] 06Jun97 Added splitAndTrim methods [djc] Notes: o splitAndTrim() should be merged into split()
| Constructor Summary | |
StringOp()
|
|
| Method Summary | |
static int |
compare(java.lang.String s1,
java.lang.String s2)
Compares its two strings for order. |
static int |
compareIgnoreCase(java.lang.String s1,
java.lang.String s2)
Compares its two strings for order. |
static int |
contains(java.lang.String[] source,
java.lang.String str)
Check to see if a string is contained in an array of strings or if a string is a substring in the array of strings. |
static int |
containsIgnoreCase(java.lang.String[] source,
java.lang.String str)
Case insensitive check to see if a string is contained in an array of strings or if a string is a substring in the array of strings. |
static boolean |
endsWith(java.lang.String source,
java.lang.String str)
Check to see if the end characters of source matches the given str. |
static boolean |
endsWithIgnoreCase(java.lang.String source,
java.lang.String str)
Check to see if the end characters of source matches the given str and ignores the case sensitivity. |
static boolean |
equals(java.lang.String[] s1,
java.lang.String[] s2)
|
static boolean |
equals(java.lang.String s1,
java.lang.String s2)
This is the quickest way to check for string equality. |
static boolean |
equalsIgnoreCase(java.lang.String s1,
java.lang.String s2)
This is the quickest way to check for string equality. |
static java.lang.String |
escape(java.lang.String inString)
Add escape backslashes to special characters in string. |
static int |
in(java.lang.String[] source,
java.lang.String str)
Check to see if a string is in a array of strings |
static int |
inIgnoreCase(java.lang.String[] source,
java.lang.String str)
Case insensitive check to see if a string is in an array of strings |
static boolean |
isEmpty(java.lang.String s1)
See if a string is null or the empty string (""). |
static java.lang.String |
nameFromInt(int num)
Return a string representation of the value. |
static java.lang.String |
nameFromLong(long num)
Return a string representation of the value. |
static java.lang.Object |
parseObject(java.lang.String str)
Parse the given string and return it. |
static java.lang.String |
removeBlanks(java.lang.String source)
Remove and white space from the supplied source. |
static java.lang.String[] |
split(java.lang.String inString,
char delim)
Split a string into an array of strings. |
static java.lang.String[] |
split(java.lang.String inString,
char delim,
char escape)
Split a string into an array of strings. |
static java.lang.String[] |
splitAndTrim(java.lang.String inString,
char delim)
Split a string into an array of strings and trim whitespace. |
static java.lang.String[] |
splitAndTrim(java.lang.String inString,
char delim,
char escape)
Split a string into an array of strings and trim whitespace. |
static boolean |
startsWith(java.lang.String source,
java.lang.String str)
Check to see if the first characters of source matches the given str. |
static boolean |
startsWithIgnoreCase(java.lang.String source,
java.lang.String str)
Check to see if the first characters of source matches the given str and ignores the case sensitivity. |
static java.lang.String |
substitute(java.lang.String inString,
java.lang.String from,
java.lang.String to)
Change all occurances of from to the value to in the provided string. |
static java.lang.String |
substituteIgnoreCase(java.lang.String inString,
java.lang.String from,
java.lang.String to)
Change all occurances of from to the value to in the provided string, ignoring case. |
static java.lang.String |
trim(java.lang.String string)
Returns a string with white space removed from both ends of a string. |
static java.lang.String |
wrap(java.lang.String source,
int width)
Wrap a string by inserting newlines. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public StringOp()
| Method Detail |
public static final int compare(java.lang.String s1,
java.lang.String s2)
s1 - One of the strings to compare.s2 - One of the strings to compare.
public static final int compareIgnoreCase(java.lang.String s1,
java.lang.String s2)
s1 - One of the strings to compare.s2 - One of the strings to compare.
public static final boolean equals(java.lang.String s1,
java.lang.String s2)
s1 - One of the strings to check.s2 - One of the strings to check.
public static final boolean equalsIgnoreCase(java.lang.String s1,
java.lang.String s2)
s1 - One of the strings to check.s2 - One of the strings to check.
public static final boolean equals(java.lang.String[] s1,
java.lang.String[] s2)
public static final boolean isEmpty(java.lang.String s1)
s1 - The string to check.public static final java.lang.String removeBlanks(java.lang.String source)
source - The string to remove white space from.
public static final java.lang.String wrap(java.lang.String source,
int width)
source - The string to wrap.width - How wide to make each line (in characters).public static final java.lang.String trim(java.lang.String string)
This method returns null if the string to be trimmed is null.
string - The string to be trimmed.
public static final java.lang.String[] splitAndTrim(java.lang.String inString,
char delim)
inString - string to be splitdelim - delimiter character
public static final java.lang.String[] splitAndTrim(java.lang.String inString,
char delim,
char escape)
inString - string to be splitdelim - delimiter character
public static final java.lang.String[] split(java.lang.String inString,
char delim)
inString - string to be splitdelim - delimiter character
public static final java.lang.String[] split(java.lang.String inString,
char delim,
char escape)
inString - string to be splitdelim - delimiter characterescape - escape characterpublic static final java.lang.String escape(java.lang.String inString)
inString - string to be escaped
public static final java.lang.String substitute(java.lang.String inString,
java.lang.String from,
java.lang.String to)
inString - String to be searched.from - String to look for as occurances.to - String to replace all occurances of from.
public static final java.lang.String substituteIgnoreCase(java.lang.String inString,
java.lang.String from,
java.lang.String to)
inString - String to be searched.from - String to look for as occurances.to - String to replace all occurances of from.public static final java.lang.String nameFromInt(int num)
num - An integer to be changed.public static final java.lang.String nameFromLong(long num)
num - A long to be changed.public static final java.lang.Object parseObject(java.lang.String str)
str - The string to parse.
public static int contains(java.lang.String[] source,
java.lang.String str)
source - The array of strings to look instr - The string or substing.
public static final int containsIgnoreCase(java.lang.String[] source,
java.lang.String str)
source - The array of strings to look instr - The string or substing.
public static final boolean endsWith(java.lang.String source,
java.lang.String str)
source - The source to check.str - The string to search for.
public static final boolean endsWithIgnoreCase(java.lang.String source,
java.lang.String str)
source - The source to check.str - The string to search for.
public static final int in(java.lang.String[] source,
java.lang.String str)
source - The array of strings to look instr - The string.
public static final int inIgnoreCase(java.lang.String[] source,
java.lang.String str)
source - The array of strings to look instr - The string.
public static final boolean startsWith(java.lang.String source,
java.lang.String str)
source - The source to check.str - The string to search for.
public static final boolean startsWithIgnoreCase(java.lang.String source,
java.lang.String str)
source - The source to check.str - The string to search for.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||