org.apache.tomcat.util.buf

## Class StringUtils

- java.lang.Object
- - org.apache.tomcat.util.buf.StringUtils

-     public final class StringUtils
      extends Object

  Utility methods to build a separated list from a given set (not java.util.Set) of inputs and return that list as a string or append it to an existing StringBuilder. If the given set is null or empty, an empty string will be returned.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `StringUtils.Function<T>`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `join(Collection<String> collection)`
    `static String` | `join(Collection<String> collection, char separator)`
    `static void` | `join(Iterable<String> iterable, char separator, StringBuilder sb)`
    `static <T> void` | `join(Iterable<T> iterable, char separator, StringUtils.Function<T> function, StringBuilder sb)`
    `static String` | `join(String[] array)`
    `static void` | `join(String[] array, char separator, StringBuilder sb)`
    `static <T> void` | `join(T[] array, char separator, StringUtils.Function<T> function, StringBuilder sb)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### join

          public static String join(String[] array)

    - #### join

          public static void join(String[] array,
                  char separator,
                  StringBuilder sb)

    - #### join

          public static String join(Collection<String> collection)

    - #### join

          public static String join(Collection<String> collection,
                    char separator)

    - #### join

          public static void join(Iterable<String> iterable,
                  char separator,
                  StringBuilder sb)

    - #### join

          public static <T> void join(T[] array,
                      char separator,
                      StringUtils.Function<T> function,
                      StringBuilder sb)

    - #### join

          public static <T> void join(Iterable<T> iterable,
                      char separator,
                      StringUtils.Function<T> function,
                      StringBuilder sb)

Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.