Class StringUtils


  • @Internal
    public final class StringUtils
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static @NotNull java.lang.String byteCountToString​(long bytes)
      Converts the given number of bytes to a human-readable string.
      static @Nullable java.lang.String capitalize​(@Nullable java.lang.String str)
      Returns a Capitalized String and all remaining chars to lower case.
      static @Nullable java.lang.String getStringAfterDot​(@Nullable java.lang.String str)  
      static @Nullable java.lang.String removeSurrounding​(@Nullable java.lang.String str, @Nullable java.lang.String delimiter)
      Removes character specified by the delimiter parameter from the beginning and the end of the string.
      • Methods inherited from class java.lang.Object

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

      • getStringAfterDot

        @Nullable
        public static @Nullable java.lang.String getStringAfterDot​(@Nullable
                                                                   @Nullable java.lang.String str)
      • capitalize

        @Nullable
        public static @Nullable java.lang.String capitalize​(@Nullable
                                                            @Nullable java.lang.String str)
        Returns a Capitalized String and all remaining chars to lower case. eg seSSioN = Session
        Parameters:
        str - the String to capitalize
        Returns:
        the capitalized String or itself if empty or null
      • removeSurrounding

        @Nullable
        public static @Nullable java.lang.String removeSurrounding​(@Nullable
                                                                   @Nullable java.lang.String str,
                                                                   @Nullable
                                                                   @Nullable java.lang.String delimiter)
        Removes character specified by the delimiter parameter from the beginning and the end of the string.
        Parameters:
        str - the String to remove surrounding string from
        delimiter - the String that is meant to be removed
        Returns:
        a string without delimiter character at the beginning and the end of the string
      • byteCountToString

        @NotNull
        public static @NotNull java.lang.String byteCountToString​(long bytes)
        Converts the given number of bytes to a human-readable string.
        Parameters:
        bytes - the number of bytes
        Returns:
        a string representing the human-readable byte count (e.g. 1kB, 20 MB, etc.)