MCPcopy Index your code
hub / github.com/fadeyev/intellijcoder / join

Method join

intellijcoder/src/intellijcoder/util/StringUtil.java:11–19  ·  view source on GitHub ↗
(Collection<String> s, String delimiter)

Source from the content-addressed store, hash-verified

9 public static final char URL_PATH_SEPARATOR = '/';
10
11 public static String join(Collection<String> s, String delimiter) {
12 if (s == null || s.isEmpty()) return "";
13 Iterator<String> iter = s.iterator();
14 StringBuilder builder = new StringBuilder(iter.next());
15 while (iter.hasNext()) {
16 builder.append(delimiter).append(iter.next());
17 }
18 return builder.toString();
19 }
20
21 public static String getFileName(String url) {
22 return url.substring( url.lastIndexOf(URL_PATH_SEPARATOR)+1, url.length() );

Callers 1

getClassPathMethod · 0.95

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected