io.katharsis.utils.StringUtils Maven / Gradle / Ivy
package io.katharsis.utils;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
public class StringUtils {
public static String join(String delimiter, Iterable stringsIterable) {
List strings = new LinkedList<>();
Iterator iterator = stringsIterable.iterator();
while (iterator.hasNext()) {
strings.add(iterator.next());
}
StringBuilder ab = new StringBuilder();
for (int i = 0; i < strings.size(); i++) {
ab.append(strings.get(i));
if (i != strings.size() - 1) {
ab.append(delimiter);
}
}
return ab.toString();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy