Creates a backslash escaped string, joining all the items. @see #escapeTextWithSeparator
(Collection<?> items, char separator)
| 182 | * @see #escapeTextWithSeparator |
| 183 | */ |
| 184 | public static String join(Collection<?> items, char separator) { |
| 185 | if (items == null) return ""; |
| 186 | StringBuilder sb = new StringBuilder(items.size() << 3); |
| 187 | boolean first = true; |
| 188 | for (Object o : items) { |
| 189 | String item = String.valueOf(o); |
| 190 | if (first) { |
| 191 | first = false; |
| 192 | } else { |
| 193 | sb.append(separator); |
| 194 | } |
| 195 | appendEscapedTextToBuilder(sb, item, separator); |
| 196 | } |
| 197 | return sb.toString(); |
| 198 | } |
| 199 | |
| 200 | public static List<String> splitWS(String s, boolean decode) { |
| 201 | ArrayList<String> lst = new ArrayList<>(2); |