Class StringUtils

java.lang.Object
de.renebergelt.utils.StringUtils

public class StringUtils extends Object
Utility functions for strings
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    join​(Iterable elements, String delimiter)
    Join the elements in the iterable (by using their toString() method) to a string by using the delimiter
    a = {"A", "B", "C"}, delimiter = ";"
    result: "A;B;C"
    static String
    join​(String[] a, String delimiter)
    Join the given array to a string by using the delimiter
    a = {"A", "B", "C"}, delimiter = ";"
    result: "A;B;C"

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • join

      public static String join(String[] a, String delimiter)
      Join the given array to a string by using the delimiter
      a = {"A", "B", "C"}, delimiter = ";"
      result: "A;B;C"
      Parameters:
      a - Array of strings to join
      delimiter - Teh delimiter to use for joining
      Returns:
      The resulting string
    • join

      public static String join(Iterable elements, String delimiter)
      Join the elements in the iterable (by using their toString() method) to a string by using the delimiter
      a = {"A", "B", "C"}, delimiter = ";"
      result: "A;B;C"
      Parameters:
      elements - Elements to join
      delimiter - The delimiter to use for joining
      Returns:
      The resulting string