Module org.firebirdsql.jaybird
Package org.firebirdsql.jaybird.util

# Class StringUtils

java.lang.Object
org.firebirdsql.jaybird.util.StringUtils

public final class StringUtils extends Object
Helper class for string operations

Since:
  4
Author:
  Mark Rotteveel

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static boolean`
  `isNullOrEmpty(@Nullable String value)`
  Checks if `value` is `null` or empty.
  `static @Nullable String`
  `trim(@Nullable String stringToTrim)`
  Null-safe trim.
  `static @Nullable String`
  `trimToNull(@Nullable String value)`
  Trims `value` if non-null, returning the trimmed value, or `null` if `value` was `null` or empty after trimming.

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

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

- ## Method Details

  - ### trimToNull

    public static @Nullable String trimToNull(@Nullable String value)
    Trims `value` if non-null, returning the trimmed value, or `null` if `value` was `null` or empty after trimming.
    Parameters:
      `value` - value to trim
    Returns:
      Trimmed string `value`, or `null` when null, or empty after trim.
    See Also:
      - `String.trim()`

  - ### isNullOrEmpty

    public static boolean isNullOrEmpty(@Nullable String value)
    Checks if `value` is `null` or empty.
    Parameters:
      `value` - value to test
    Returns:
      `true` if `value` is `null` or emoty, `false` for non-empty strings
    Since:
      6

  - ### trim

    public static @Nullable String trim(@Nullable String stringToTrim)
    Null-safe trim.
    Parameters:
      `stringToTrim` - String to trim
    Returns:
      result of `stringToTrim.trim()` (or `null` if `stringToTrim` was null
    Since:
      6