Class Strings


  • public final class Strings
    extends java.lang.Object
    Extra string utilities.
    Since:
    4.0.0
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isBlank​(java.lang.String test)
      Return if the input string is empty or has no non-whitespace characters.
      static java.lang.String repeat​(java.lang.String content, int times)
      Create a new string with the contents of the provided string repeated times times.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • repeat

        public static java.lang.String repeat​(java.lang.String content,
                                              int times)
        Create a new string with the contents of the provided string repeated times times.

        Available in String itself as of JDK 11.

        Parameters:
        content - text to repeat
        times - amount to repeat
        Returns:
        repeated string
        Since:
        4.0.0
      • isBlank

        public static boolean isBlank​(java.lang.String test)
        Return if the input string is empty or has no non-whitespace characters.

        This matches the behaviour of String.isBlank() in Java 11+.

        Parameters:
        test - input string to test
        Returns:
        if the input string is blank
        Since:
        4.0.0