Class StringUtils

java.lang.Object
org.ow2.clif.jenkins.utils.StringUtils

public class StringUtils extends Object
  • Method Details

    • countMatches

      public static int countMatches(String value, int character)
      Count the number of character occurrences in a string
      Parameters:
      value - the source string where to look for character occurrences
      character - the character to look for
      Returns:
      the number of occurrences of the given character in the given string value, or 0 if value is null
    • endsWithIgnoreCase

      public static boolean endsWithIgnoreCase(String value, String suffix)
      Checks if a string ends with a given string, in a case-insensitive way
      Parameters:
      value - the full string
      suffix - the terminating substring to check, case-insensitive
      Returns:
      true if value is non-null and contains suffix, false otherwise. Special cases:
      • True when suffix is the empty string and value is non-null
      • False when suffix is null
    • isBlank

      public static boolean isBlank(String value)
      Checks a string is null or empty, trimming whitespaces
      Returns:
      true if the given string is null or empty, regardless of possible whitespaces, false otherwise
    • isNotBlank

      public static boolean isNotBlank(String value)
      Checks a string is not null and not empty, trimming whitespaces
      Returns:
      true if the given string is not null and not empty, regardless of possible whitespaces, false otherwise