List of utility methods to do Comma Separated List
double | resolveCommandParam(List resolve Command Param String v = resolveCommandParam(params, name, null);
return v == null ? defaultValue : Double.parseDouble(v);
|
ArrayList | splitCommandsToList(String row, String delimiter) Splits commands to list with given delimiter. ArrayList<String> returnCommands = new ArrayList<String>(); if (row == null || row.trim().equals("")) return returnCommands; try { String[] split = row.split(delimiter); for (String command : split) { returnCommands.add(command); } catch (Exception e) { System.out.println("Error splitting commands to list: " + e); e.printStackTrace(); return returnCommands; |
String | splitListByComma(List Split list by comma. boolean firstHost = true; StringBuilder hostConnection = new StringBuilder(); for (String host : hosts) { if (!firstHost) { hostConnection.append(","); hostConnection.append(host.trim()); firstHost = false; ... |
String | splitListWithComma(List StringList) split List With Comma StringBuffer strOfList = new StringBuffer(""); for (int i = 0; i < StringList.size(); i++) { if (i != 0) { strOfList.append(","); strOfList.append(StringList.get(i).toString()); return strOfList.toString(); ... |
List | splitOnCommas(final String commaSeparatedList) split On Commas if (commaSeparatedList == null) { return null; final String removeLeadingWhiteSpace = removeLeadingWhiteSpace(commaSeparatedList); if (removeLeadingWhiteSpace.length() == 0) { return Collections.emptyList(); final String[] splitAsArray = removeLeadingWhiteSpace.split("\\W*,\\W*"); ... |
String | stringListStringWithoutBracketsCommaSeparated(List string List String Without Brackets Comma Separated return stringListStringWithoutBracketsWithSpecifiedSeparator(list, ","); |
String | stringsToCommaString(List strings) Takes a list of strings and joins them with a comma. return stringsToString(strings, ","); |
String | stringToCommaText(List string To Comma Text String text = ""; if (strings.size() > 0) { for (String s : strings) { if (text.length() > 0) { text = text + ", "; text = text + "cpgf::" + s; return text; |
List | stringToList(final String commaSeparated) string To List return appendDelimitedStringToList(commaSeparated, new ArrayList<String>()); |
List | stringToList(String commaSeparatedList) string To List ArrayList<String> list = new ArrayList<String>(); String[] preprocessedList = commaSeparatedList.split(","); for (String string : preprocessedList) { list.add(string.trim()); return list; |