MCPcopy Create free account
hub / github.com/antlr/codebuff / join

Method join

output/java_guava/1.4.18/Chars.java:369–381  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

toStringMethod · 0.65
checkNotNullMethod · 0.45
lengthMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected