From cc33285f5f08e6a0c9f5012e95fe61a7b1d2fe91 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Wed, 29 Jun 2016 19:36:31 +0200 Subject: [PATCH] Added toStringSeparatedBy method in StringListUtils. --- .../devinsy/util/strings/StringListUtils.java | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/src/fr/devinsy/util/strings/StringListUtils.java b/src/fr/devinsy/util/strings/StringListUtils.java index 2c97490..a53461e 100644 --- a/src/fr/devinsy/util/strings/StringListUtils.java +++ b/src/fr/devinsy/util/strings/StringListUtils.java @@ -495,6 +495,72 @@ public class StringListUtils return result; } + /** + * + * @param source + * @return + */ + public static String toStringSeparatedBy(final Collection source, final String separator) + { + String result; + + if (source == null) + { + result = null; + } + else + { + result = new StringList(source).toStringSeparatedBy(separator); + } + + // + return result; + } + + /** + * + * @param strings + * @return + */ + public static String toStringSeparatedBy(final String[] source, final String separator) + { + String result; + + if (source == null) + { + result = null; + } + else + { + result = new StringList(source).toStringSeparatedBy(separator); + } + + // + return result; + } + + /** + * + * @param strings + * @return + */ + public static String toStringSeparatedBy(final StringList source, final String separator) + { + String result; + + if (source == null) + { + result = null; + } + else + { + result = source.toStringSeparatedBy(separator); + } + + // + return result; + } + /** * * @param strings