MCPcopy Create free account
hub / github.com/0linlin0/CyberBox / join

Method join

Skay_Exp/src/tools/Strings.java:10–21  ·  view source on GitHub ↗
(Iterable<String> strings, String sep, String prefix, String suffix)

Source from the content-addressed store, hash-verified

8
9public class Strings {
10 public static String join(Iterable<String> strings, String sep, String prefix, String suffix) {
11 final StringBuilder sb = new StringBuilder();
12 boolean first = true;
13 for (String s : strings) {
14 if (! first) sb.append(sep);
15 if (prefix != null) sb.append(prefix);
16 sb.append(s);
17 if (suffix != null) sb.append(suffix);
18 first = false;
19 }
20 return sb.toString();
21 }
22
23 public static String repeat(String str, int num) {
24 final String[] strs = new String[num];

Callers 2

repeatMethod · 0.95
formatTableMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected