Improved: Remove unused ‘StringUtil#split’ overload
(OFBIZ-11014) git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1859923 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -139,38 +139,6 @@ public class StringUtil {
|
||||
return splitList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Splits a String on a delimiter into a List of Strings.
|
||||
* @param str the String to split
|
||||
* @param delim the delimiter character(s) to join on (null will split on whitespace)
|
||||
* @param limit see String.split() method
|
||||
* @return a list of Strings
|
||||
*/
|
||||
public static List<String> split(String str, String delim, int limit) {
|
||||
List<String> splitList = null;
|
||||
String[] st = null;
|
||||
|
||||
if (str == null) {
|
||||
return splitList;
|
||||
}
|
||||
|
||||
if (delim != null) {
|
||||
st = Pattern.compile(delim).split(str, limit);
|
||||
} else {
|
||||
st = str.split("\\s");
|
||||
}
|
||||
|
||||
|
||||
if (st != null && st.length > 0) {
|
||||
splitList = new LinkedList<>();
|
||||
for (String element : st) {
|
||||
splitList.add(element);
|
||||
}
|
||||
}
|
||||
|
||||
return splitList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Encloses each of a List of Strings in quotes.
|
||||
* @param list List of String(s) to quote.
|
||||
|
||||
Reference in New Issue
Block a user