Class StringHelper

java.lang.Object
io.bdeploy.common.util.StringHelper

public class StringHelper extends Object
Helper for String
  • Method Details

    • isNullOrEmpty

      public static boolean isNullOrEmpty(String s)
      Returns whether the given string is null or empty
    • isAllLowerCase

      public static boolean isAllLowerCase(String s)
      Checks if the string contains only lowercase characters.
    • repeat

      public static String repeat(String string, int count)
      Returns a string whose value is the concatenation of this string repeated count times.

      If this string is empty or count is zero then the empty string is returned.

      This is less efficient than the Java 11 implementation as we cannot reuse the original Strings encoding to fill arrays.

      Parameters:
      count - number of times to repeat
      Returns:
      A string composed of this string repeated count times or the empty string if this string is empty or count is zero
      Throws:
      IllegalArgumentException - if the count is negative.