From: James Moger Date: Fri, 28 Feb 2014 22:55:22 +0000 (-0500) Subject: Add flatten string array to StringUtils X-Git-Tag: v1.4.0~79 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4bdd3958a1d1167063acdf3a0cca49ac56b8e446;p=gitblit.git Add flatten string array to StringUtils --- diff --git a/src/main/java/com/gitblit/utils/StringUtils.java b/src/main/java/com/gitblit/utils/StringUtils.java index 8a2af070..5813c3ae 100644 --- a/src/main/java/com/gitblit/utils/StringUtils.java +++ b/src/main/java/com/gitblit/utils/StringUtils.java @@ -137,6 +137,18 @@ public class StringUtils { return retStr.toString(); } + /** + * Flatten the list of strings into a single string with the specified + * separator. + * + * @param values + * @param separator + * @return flattened list + */ + public static String flattenStrings(String[] values, String separator) { + return flattenStrings(Arrays.asList(values), separator); + } + /** * Flatten the list of strings into a single string with a space separator. *