| java.lang.Object de.mcs.utils.StringUtils
StringUtils | final public class StringUtils (Code) | | This class provides static util methods for String manaipulation that aren't
part of the default JDK functionalities.
author: w.klaas |
Method Summary | |
public static String | arrayToCSVString(String[] array) convinient methode for converting. | public static String | arrayToCSVString(String[] array, char localseparators, char localdelimiter) Takes an array of tokens and converts into separator-separated string.
Parameters: array - The array of strings input. Parameters: localseparators - The separator char. Parameters: localdelimiter - The delimiter char. | public static String | byteArrayToMimeString(byte[] array) Convert byte array to a mime coded string. | public static String[] | csvStringToArray(String string) Converts a delimited string into an array of string tokens. | public static String[] | csvStringToArray(String str, char localseparators, char localdelimiter) Converts a delimited string into an array of string tokens.
Parameters: str - The 'separator' separated string. Parameters: localseparators - The separator char. Parameters: localdelimiter - The delimiter char. | public static String | formatFieldData(String aValue, int size) Getting the value formatted to the actual fieldsize. | public static int | isInArray(String[] fieldProps, String strSearchValue) Check strSearchValue is in Array. | public static String | md5String(String s) building the md5 hash of an String. | public static byte[] | md5StringBytes(String s) Method md5String. | public static byte[] | mimeStringTobyteArray(String string) Convert a mimecoded string to a array of byte. | public static String | removeChars(String data, String removeChars) Remove a given set of characters from a String.
Parameters: data - The input string to be cleansed of 'removeChars'. Parameters: removeChars - The characters to be removed. | public static StringBuffer | replaceAll(StringBuffer buffer, String find, String replacement) Replaces all the occurences of a substring found within a StringBuffer by
a replacement string. | public static String | replaceVars(String origString, Map vars) Performs variable substitution for a string. | public static String | stripExtension(String filename) Given a filename, strips the .extension. | public static List<String> | toList(String[] strings) converts a string array into a list of strings. | public static byte[] | xorArrays(byte[] arg0, byte[] arg1) xorArrays. |
arrayToCSVString | public static String arrayToCSVString(String[] array)(Code) | | convinient methode for converting. seperator will be ',' delimiter will
be '"'.
Parameters: array - The array of strings input. String A string containing tokens separated by seperator. |
arrayToCSVString | public static String arrayToCSVString(String[] array, char localseparators, char localdelimiter)(Code) | | Takes an array of tokens and converts into separator-separated string.
Parameters: array - The array of strings input. Parameters: localseparators - The separator char. Parameters: localdelimiter - The delimiter char. String A string containing tokens separated by seperator. |
byteArrayToMimeString | public static String byteArrayToMimeString(byte[] array) throws IOException(Code) | | Convert byte array to a mime coded string.
Parameters: array - the array to convert mime coded String throws: IOException - if something goes wrong |
csvStringToArray | public static String[] csvStringToArray(String string)(Code) | | Converts a delimited string into an array of string tokens. Separator is
',', delimiter is '"'
Parameters: string - The 'separator' separated string. String[] A string array of the original tokens. |
csvStringToArray | public static String[] csvStringToArray(String str, char localseparators, char localdelimiter)(Code) | | Converts a delimited string into an array of string tokens.
Parameters: str - The 'separator' separated string. Parameters: localseparators - The separator char. Parameters: localdelimiter - The delimiter char. String[] A string array of the original tokens. |
formatFieldData | public static String formatFieldData(String aValue, int size)(Code) | | Getting the value formatted to the actual fieldsize.
Parameters: aValue - value to format Parameters: size - array index of this field String |
isInArray | public static int isInArray(String[] fieldProps, String strSearchValue)(Code) | | Check strSearchValue is in Array.
Parameters: fieldProps - Array Parameters: strSearchValue - SearchString integer Value of Index in Array |
md5String | public static String md5String(String s)(Code) | | building the md5 hash of an String.
Parameters: s - String String |
md5StringBytes | public static byte[] md5StringBytes(String s)(Code) | | Method md5String.
Parameters: s - String byte[[] |
mimeStringTobyteArray | public static byte[] mimeStringTobyteArray(String string) throws Exception(Code) | | Convert a mimecoded string to a array of byte.
Parameters: string - the mime coded string an array of byte throws: Exception - if something goes wrong |
removeChars | public static String removeChars(String data, String removeChars)(Code) | | Remove a given set of characters from a String.
Parameters: data - The input string to be cleansed of 'removeChars'. Parameters: removeChars - The characters to be removed. String The new string cleansed of 'removeChars'. |
replaceAll | public static StringBuffer replaceAll(StringBuffer buffer, String find, String replacement)(Code) | | Replaces all the occurences of a substring found within a StringBuffer by
a replacement string.
Parameters: buffer - the StringBuffer in where the replace will take place Parameters: find - the substring to find and replace Parameters: replacement - the replacement string for all occurences of find the original StringBuffer where all the occurences of find arereplaced by replacement |
replaceVars | public static String replaceVars(String origString, Map vars)(Code) | | Performs variable substitution for a string. String is scanned for
${variable_name} and if one is found, it is replaced with corresponding
value from the vars hashtable.
Parameters: origString - unmodified string Parameters: vars - Hashtable of replacement values modified string exception: Exception - |
stripExtension | public static String stripExtension(String filename)(Code) | | Given a filename, strips the .extension.
Parameters: filename - filename to strip String filename without .extension |
toList | public static List<String> toList(String[] strings)(Code) | | converts a string array into a list of strings.
Parameters: strings - string array to convert to a list. |
xorArrays | public static byte[] xorArrays(byte[] arg0, byte[] arg1)(Code) | | xorArrays.
Parameters: arg0 - byte[] Parameters: arg1 - byte[] byte[] |
|
|