Returns a string containing the supplied char values separated by separator. For example, join("-", '1', '2', '3') returns the string "1-2-3". @param separator the text that should appear between consecutive values in the resulting string (but not at the start or
(String separator, char... array)
| 367 | |
| 368 | |
| 369 | public static String join(String separator, char... array) { |
| 370 | checkNotNull(separator); |
| 371 | int len = array.length; |
| 372 | if (len == 0) { |
| 373 | return ""; |
| 374 | } |
| 375 | StringBuilder builder = new StringBuilder(len + separator.length() * (len - 1)); |
| 376 | builder.append(array[0]); |
| 377 | for (int i = 1; i < len; i++) { |
| 378 | builder.append(separator).append(array[i]); |
| 379 | } |
| 380 | return builder.toString(); |
| 381 | } |
| 382 | |
| 383 | /** |
| 384 | * Returns a comparator that compares two {@code char} arrays <a |
nothing calls this directly
no test coverage detected