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

Method join

output/java/1.4.17/Misc.java:51–60  ·  view source on GitHub ↗
(Iterator<?> iter, String separator)

Source from the content-addressed store, hash-verified

49 // Seriously: why isn't this built in to java?
50
51 public static String join(Iterator<?> iter, String separator) {
52 StringBuilder buf = new StringBuilder();
53 while ( iter.hasNext() ) {
54 buf.append(iter.next());
55 if ( iter.hasNext() ) {
56 buf.append(separator);
57 }
58 }
59 return buf.toString();
60 }
61
62// public static String join(Object[] a, String separator, int start, int stop) {
63// StringBuilder buf = new StringBuilder();

Callers 5

openMethod · 0.95
updateStackMethod · 0.95
showMethod · 0.95
mainFunction · 0.45
waitForCloseMethod · 0.45

Calls 4

nextMethod · 0.65
toStringMethod · 0.65
hasNextMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected