com.aliyuncs.utils.StringUtils Maven / Gradle / Ivy
package com.aliyuncs.utils;
public class StringUtils {
public static boolean isEmpty(final CharSequence cs) {
return cs == null || cs.length() == 0;
}
public static String join(String delimiter, Iterable extends String> elements) {
if (isEmpty(delimiter) || elements == null) {
return "";
}
StringBuilder stringBuilder = new StringBuilder();
for (String value : elements) {
stringBuilder.append(value);
stringBuilder.append(delimiter);
}
if (stringBuilder.length() > 0) {
stringBuilder.deleteCharAt(stringBuilder.length() - 1);
}
return stringBuilder.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy