Join multiple strings into a string delimited by the given delimiter. @param s a collection of strings @param delimiter the delimiter @return a 'delimiter' separated string
(AbstractCollection<String> s, String delimiter)
| 151 | * @return a 'delimiter' separated string |
| 152 | */ |
| 153 | public static String join(AbstractCollection<String> s, String delimiter) { |
| 154 | if (s.isEmpty()) return ""; |
| 155 | Iterator<String> iter = s.iterator(); |
| 156 | StringBuffer buffer = new StringBuffer(iter.next()); |
| 157 | while (iter.hasNext()) { |
| 158 | buffer.append(delimiter); |
| 159 | buffer.append(iter.next()); |
| 160 | } |
| 161 | return buffer.toString(); |
| 162 | } |
| 163 | |
| 164 | /** |
| 165 | * Parse comma separated path strings into a string array. This method |