de.caff.util

## Class StringHelper

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

-     public class StringHelper
      extends java.lang.Object

  Since:
    November 23, 2023
  Author:
    Rammi

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.util.regex.Pattern` | `EOL_PATTERN` The end-of-line pattern.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `StringHelper()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `trimMultiLineText(java.lang.String text)` Canonize multi-line texts so that each individual line is trimmed.
    `static java.lang.String` | `trimMultiLineText(java.lang.String text, boolean trimEnds)` Canonize multi-line texts so that each individual line is trimmed.

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

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

- - ### Field Detail

    - #### EOL_PATTERN

          public static final java.util.regex.Pattern EOL_PATTERN

      The end-of-line pattern. This is most useful for splitting multi-line texts into lines.

  - ### Constructor Detail

    - #### StringHelper

          public StringHelper()

  - ### Method Detail

    - #### trimMultiLineText

          public static java.lang.String trimMultiLineText(java.lang.String text)

      Canonize multi-line texts so that each individual line is trimmed.
      Parameters:
        `text` - text possibly consisting of more than one line, a `null` text will return `null`
      Returns:
        text with trimmed lines

    - #### trimMultiLineText

          public static java.lang.String trimMultiLineText(java.lang.String text,
                                                           boolean trimEnds)

      Canonize multi-line texts so that each individual line is trimmed.
      Parameters:
        `text` - text possibly consisting of more than one line, a `null` text will return `null`
        `trimEnds` - trim away empty lines at the beginning and the end?
      Returns:
        text with trimmed lines