com.ibm.di.util
Class StringUtils
java.lang.Object
com.ibm.di.util.StringUtils
public class StringUtils
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
lastError
public Exception lastError
StringUtils
public StringUtils()
getLastError
public Exception getLastError()
toHex
public static String toHex(byte b)
appendHex
public static void appendHex(byte b,
StringBuilder buffer)
appendHex
public static void appendHex(char c,
StringBuilder buffer)
toHex
public static String toHex(char c)
toHex
public static String toHex(String str)
nibble
public static byte nibble(char ch)
throws NumberFormatException
- Throws:
NumberFormatException
fromHex
public static byte fromHex(String hex)
throws NumberFormatException
- Throws:
NumberFormatException
toPrint
public static String toPrint(String str)
fromPrint
public static String fromPrint(String str)
splitstring
public static Vector<String> splitstring(String str,
String key)
splitstringArr
public static String[] splitstringArr(String str,
String key)
toBase64
public String toBase64(String source)
toASCII
public static String toASCII(String s)
- Convert a string to ASCII. Non-ASCII characters will be escaped using the
Unicode escape Java notation: "\\uxxx".
- Parameters:
s
- A string, which may include non ASCII characters.
- Returns:
- A string that contains only ASCII characters.
splitStringTokenCount
public static int splitStringTokenCount(String s,
char delim)
- Calculates the number of non-empty tokens in a string.
- Parameters:
s
- delim
-
- Returns:
- See Also:
splitString(String, char)
splitString
public static String[] splitString(String s,
char delim)
- Split string into non-empty tokens using the specified delimeter. This
routine is supposed to be faster than
String.split(String)
.
- Parameters:
s
- String to be split into tokens.delim
- Delimeter character.
- Returns:
- An array of tokens. Will never be null.
- See Also:
splitStringTokenCount(String, char)