Class StringUtils

java.lang.Object
nva.commons.core.StringUtils

public final class StringUtils extends Object
  • Field Details

  • Method Details

    • removeMultipleWhiteSpaces

      public static String removeMultipleWhiteSpaces(String input)
      Replaces multiple consecutive whitespaces with a single whitespace.
      Parameters:
      input - A string with or without multiple consecutive whitespaces.
      Returns:
      A string without multiple consecutive whitespaces where are whitespaces have been replaced by a space.
    • removeWhiteSpaces

      public static String removeWhiteSpaces(String input)
      Remove all whitespaces.
      Parameters:
      input - A string with or without multiple consecutive whitespaces.
      Returns:
      a string without spaces.
    • isBlank

      public static boolean isBlank(String input)
      Checks if string input is blank or null.
      Parameters:
      input - input string
      Returns:
      true if blank.
    • isEmpty

      public static boolean isEmpty(String input)
      Checks if string input is empty or null.
      Parameters:
      input - input string
      Returns:
      true if empty.
    • replaceWhiteSpacesWithSpace

      public static String replaceWhiteSpacesWithSpace(String str)
      Replaces whitespaces with space.
      Parameters:
      str - input string.
      Returns:
      string with all whitespaces replaced by spaces
    • isNotEmpty

      public static boolean isNotEmpty(String string)
      Checks if string is neither null or empty.
      Parameters:
      string - string to check
      Returns:
      true if string is neither null or empty.
    • isNotBlank

      public static boolean isNotBlank(String string)
      Checks if string is neither null or blank.
      Parameters:
      string - string to check
      Returns:
      true if string is neither null or empty.