diff options
author | James Moger <james.moger@gitblit.com> | 2014-02-28 17:55:22 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-03-01 09:21:32 -0500 |
commit | 4bdd3958a1d1167063acdf3a0cca49ac56b8e446 (patch) | |
tree | 738d6ab659f21eb5831165e63ff5e8336bc345d4 | |
parent | 16aa5a06b3728f2a6c5b94bc36ce6cf6e266b286 (diff) | |
download | gitblit-4bdd3958a1d1167063acdf3a0cca49ac56b8e446.tar.gz gitblit-4bdd3958a1d1167063acdf3a0cca49ac56b8e446.zip |
Add flatten string array to StringUtils
-rw-r--r-- | src/main/java/com/gitblit/utils/StringUtils.java | 12 |
1 files changed, 12 insertions, 0 deletions
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 @@ -138,6 +138,18 @@ public class StringUtils { }
/**
+ * 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.
*
* @param values
|