Class StringUtil

  • public final class StringUtil
    extends java.lang.Object
    Sebastian Menski
    • Constructor Summary

      Constructor Description
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String joinCommaSeparatedList​(java.util.List<java.lang.String> list)
      Joins a list of Strings to a comma separated single String.
      static java.lang.String joinList​(java.util.List<java.lang.String> list, java.lang.String separator)  
      static java.util.List<java.lang.String> splitCommaSeparatedList​(java.lang.String text)
      Splits a comma separated list in to single Strings.
      static java.util.List<java.lang.String> splitListBySeparator​(java.lang.String text, java.lang.String separator)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StringUtil

        public StringUtil()
    • Method Detail

      • splitCommaSeparatedList

        public static java.util.List<java.lang.String> splitCommaSeparatedList​(java.lang.String text)
        Splits a comma separated list in to single Strings. The list can contain expressions with commas in it.
        text - the comma separated list
        the Strings of the list or an empty List if text is empty or null
      • joinCommaSeparatedList

        public static java.lang.String joinCommaSeparatedList​(java.util.List<java.lang.String> list)
        Joins a list of Strings to a comma separated single String.
        list - the list to join
        the resulting comma separated string or null if the list is null
      • splitListBySeparator

        public static java.util.List<java.lang.String> splitListBySeparator​(java.lang.String text,
                                                                            java.lang.String separator)
      • joinList

        public static java.lang.String joinList​(java.util.List<java.lang.String> list,
                                                java.lang.String separator)