|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.novell.nds.dirxml.util.StringUtil
public class StringUtil
A class to hold various string processing utility functions
| Constructor Summary | |
|---|---|
StringUtil()
|
|
| Method Summary | |
|---|---|
static byte[] |
decodeAsciiHex(String encodedData)
Decode a string that represents binary data encoded in ASCII hex. |
static String |
encodeAsciiHex(byte[] data)
Encode an array of bytes as an ASCII-hex string. |
static boolean |
endsWithIgnoreCase(String string1,
String string2)
Case insensitive version of startsWith |
static boolean |
equalIgnoreCase(char c1,
char c2)
Do a case insensitive comparison of characters for equality |
static Comparator |
getCaseIgnoreComparator()
|
static Comparator |
getNumericStringComparator()
|
static String |
GUIDToString(byte[] binaryGUID)
Method to change from a binary GUID to canonical string representation. |
static int |
indexOfIgnoreCase(String string,
char ch)
Case insensitive version of indexOf |
static int |
indexOfIgnoreCase(String string,
char ch,
int fromIndex)
Case insensitive version of indexOf |
static int |
indexOfIgnoreCase(String string1,
String string2)
Case insensitive version of indexOf |
static int |
indexOfIgnoreCase(String string1,
String string2,
int fromIndex)
Case insensitive version of indexOf |
static String |
join(String[] strings,
String delimiter)
Join the elements of an array of Strings into a single string separated by a delimiter string. |
static boolean |
startsWithIgnoreCase(String string1,
String string2)
Case insensitive version of startsWith |
static byte[] |
stringToGUID(String stringGUID)
Method to change from a binary GUID to canonical string representation. |
static String |
substring(String string,
int start,
int length)
A different kind of substring the that provided by java.lang.String |
static String |
substringAfter(String string1,
String string2)
Get the substring that consists of the sequence characters in string1 that occur after the string2 in string1 |
static String |
substringAfterIgnoreCase(String string1,
String string2)
Get the substring that consists of the sequence characters in string1 that occur after the string2 in string1 (ignoring case) |
static String |
substringBefore(String string1,
String string2)
Get the substring that consists of the sequence characters in string1 that occur before the string2 in string1 |
static String |
substringBeforeIgnoreCase(String string1,
String string2)
Get the substring that consists of the sequence characters in string1 that occur before the string2 in string1 (ignoring case) |
static String |
toLowerCaseChars(String string)
Convert all the characters in a string to lower case. |
static String |
toUpperCaseChars(String string)
Convert all the characters in a string to upper case. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringUtil()
| Method Detail |
|---|
public static String toUpperCaseChars(String string)
string - the string to convert
public static String toLowerCaseChars(String string)
string - the string to convert
public static boolean equalIgnoreCase(char c1,
char c2)
c1 - the first characterc2 - the second character
public static int indexOfIgnoreCase(String string,
char ch)
string - a string.ch - a character.
-1 if the character does not occur.
public static int indexOfIgnoreCase(String string,
char ch,
int fromIndex)
string - a string.ch - a character.fromIndex - the index to start the search from.
-1 if the character does not occur.
public static int indexOfIgnoreCase(String string1,
String string2)
string1 - a string.string2 - a string.
-1 is returned.
public static int indexOfIgnoreCase(String string1,
String string2,
int fromIndex)
string1 - a string.string2 - a string.fromIndex - the index from which to start the search.
-1 is returned.
public static boolean startsWithIgnoreCase(String string1,
String string2)
string1 - a string.string2 - a string.
public static boolean endsWithIgnoreCase(String string1,
String string2)
string1 - a string.string2 - a string.
public static String substring(String string,
int start,
int length)
string - a string.start - the starting index of the substring;
if negative then it becomes string.length() + index;
if still negative then 0 is usedlength - the length of the string to get;
if greater than what is available, only what is available is gotten
if negative then it is length of string + 1 + length, or 0 whichever is greater
public static String substringBefore(String string1,
String string2)
string1 - a stringstring2 - a string
public static String substringBeforeIgnoreCase(String string1,
String string2)
string1 - a stringstring2 - a string
public static String substringAfter(String string1,
String string2)
string1 - a stringstring2 - a string
public static String substringAfterIgnoreCase(String string1,
String string2)
string1 - a stringstring2 - a string
public static Comparator getCaseIgnoreComparator()
public static Comparator getNumericStringComparator()
public static String GUIDToString(byte[] binaryGUID)
We do this so that the association value is more human-readable as it appears in the directory.
binaryGUID - The binary GUID
public static byte[] stringToGUID(String stringGUID)
We do this so that the association value is more human-readable as it appears in the directory.
stringGUID - The string GUID
public static byte[] decodeAsciiHex(String encodedData)
encodedData - The encoded data string
public static String encodeAsciiHex(byte[] data)
data - The data to be encoded.
public static String join(String[] strings,
String delimiter)
Strings into a single string separated by a delimiter string.
strings - an array of stringsdelimiter - the delimiter string
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||