de.caff.util

## Class StringTool

- java.lang.Object
- - de.caff.util.StringTool

-     public final class StringTool
      extends java.lang.Object

  Helper class with tools for string handling.
  Since:
    May 27, 2021
  Author:
    Rammi

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static int` | `calcLongestLineLength(java.lang.String text)` Calculate the length of the longest line in the given text.
    `static Indexable<java.lang.String>` | `split(java.lang.String str, java.util.regex.Pattern pattern)` Split a string at a given regular expression pattern.
    `static Indexable<java.lang.String>` | `splitRaw(java.lang.String str, char separator)` Split a string at a given separator character.
    `static Indexable<java.lang.String>` | `splitRaw(java.lang.String str, java.lang.String pattern)` Split a string at a given raw string pattern.
    `static Indexable<java.lang.String>` | `splitRegex(java.lang.String str, java.lang.String pattern)` Split a string at a given regular expression pattern.

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

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

- - ### Method Detail

    - #### splitRaw

          @NotNull
          public static Indexable<java.lang.String> splitRaw(@NotNull
                                                                      java.lang.String str,
                                                                      char separator)

      Split a string at a given separator character.
      Parameters:
        `str` - string to split
        `separator` - separator character (not handled as a regular expression)
      Returns:
        parts of the string created by splitting it at the given simple separator

    - #### splitRaw

          @NotNull
          public static Indexable<java.lang.String> splitRaw(@NotNull
                                                                      java.lang.String str,
                                                                      @NotNull
                                                                      java.lang.String pattern)

      Split a string at a given raw string pattern.
      Parameters:
        `str` - string to split
        `pattern` - separator pattern (not handled as a regular expression)
      Returns:
        parts of the string created by splitting it at the given simple separator pattern

    - #### splitRegex

          @NotNull
          public static Indexable<java.lang.String> splitRegex(@NotNull
                                                                        java.lang.String str,
                                                                        @NotNull
                                                                        java.lang.String pattern)

      Split a string at a given regular expression pattern.
      Parameters:
        `str` - string to split
        `pattern` - separator pattern
      Returns:
        parts of the string created by splitting it at the given simple separator pattern

    - #### split

          @NotNull
          public static Indexable<java.lang.String> split(@NotNull
                                                                   java.lang.String str,
                                                                   @NotNull
                                                                   java.util.regex.Pattern pattern)

      Split a string at a given regular expression pattern.
      Parameters:
        `str` - string to split
        `pattern` - separator pattern
      Returns:
        parts of the string created by splitting it at the given simple separator pattern

    - #### calcLongestLineLength

          public static int calcLongestLineLength(@NotNull
                                                  java.lang.String text)

      Calculate the length of the longest line in the given text.
      Parameters:
        `text` - text to check
      Returns:
        the length of the longest line, w/o the linefeed character(s)