Class StringUtil

java.lang.Object
de.murmelmeister.library.utils.StringUtil

public final class StringUtil extends Object
Utility class for string operations.
  • Constructor Details

    • StringUtil

      public StringUtil()
  • Method Details

    • startsWithIgnoreCase

      public static boolean startsWithIgnoreCase(String str, String prefix)
      Checks if a String starts with another String ignoring case sensitivity.
      Parameters:
      str - the input String to check
      prefix - the prefix to check against
      Returns:
      true if the input String starts with the specified prefix, ignoring case sensitivity, or false otherwise. Returns false if either the input String or the prefix is null.
    • normalize

      public static String normalize(String input)
      Normalizes the provided String by stripping leading and trailing whitespace and returning null when the result is empty or the input is null.
      Parameters:
      input - the String to normalize
      Returns:
      the stripped String, or null if the input is null or blank