| java.lang.Object org.ofbiz.base.util.StringUtil
StringUtil | public class StringUtil (Code) | | Misc String Utility Functions
author: Andy Zeneski version: $Revision: 1.5 $ since: 2.0 |
cleanUpPathPrefix | public static String cleanUpPathPrefix(String prefix)(Code) | | Make sure the string starts with a forward slash but does not end with one; converts back-slashes to forward-slashes; if in String is null or empty, returns zero length string.
|
createMap | public static Map createMap(List keys, List values)(Code) | | Create a Map from a List of keys and a List of values
Parameters: keys - List of keys Parameters: values - List of values Map of combined lists throws: IllegalArgumentException - When either List is null or the sizes do not equal |
fromHexString | public static byte[] fromHexString(String str)(Code) | | |
join | public static String join(List list, String delim)(Code) | | Creates a single string from a List of strings seperated by a delimiter.
Parameters: list - a list of strings to join Parameters: delim - the delimiter character(s) to use. (null value will join with no delimiter) a String of all values in the list seperated by the delimiter |
mapToStr | public static String mapToStr(Map map)(Code) | | Creates an encoded String from a Map of name/value pairs (MUST BE STRINGS!)
Parameters: map - The Map of name/value pairs String The encoded String |
quoteStrList | public static List quoteStrList(List list)(Code) | | Encloses each of a List of Strings in quotes.
Parameters: list - List of String(s) to quote. |
removeSpaces | public static String removeSpaces(String str)(Code) | | Removes all spaces from a string
|
replaceString | public static String replaceString(String mainString, String oldString, String newString)(Code) | | Replaces all occurances of oldString in mainString with newString
Parameters: mainString - The original string Parameters: oldString - The string to replace Parameters: newString - The string to insert in place of the old mainString with all occurances of oldString replaced by newString |
split | public static List split(String str, String delim)(Code) | | Splits a String on a delimiter into a List of Strings.
Parameters: str - the String to split Parameters: delim - the delimiter character(s) to join on (null will split on whitespace) a list of Strings |
strToMap | public static Map strToMap(String str, boolean trim)(Code) | | Creates a Map from an encoded name/value pair string
Parameters: str - The string to decode and format Parameters: trim - Trim whitespace off fields a Map of name/value pairs |
strToMap | public static Map strToMap(String str)(Code) | | Creates a Map from an encoded name/value pair string
Parameters: str - The string to decode and format a Map of name/value pairs |
toHexString | public static String toHexString(byte[] bytes)(Code) | | |
|
|