Class StringUtils


  • public class StringUtils
    extends Object
    The type String utils.
    Author:
    Harsh Shah
    • Constructor Detail

      • StringUtils

        public StringUtils()
    • Method Detail

      • isEmpty

        public static boolean isEmpty​(String str)
        Is empty boolean.
        Parameters:
        str - the str
        Returns:
        boolean boolean
      • isNotEmpty

        public static boolean isNotEmpty​(String str)
        Is not empty boolean.
        Parameters:
        str - the str
        Returns:
        boolean boolean
      • isAnyEmpty

        public static boolean isAnyEmpty​(String... strs)
        Is any empty boolean.
        Parameters:
        strs - the strs
        Returns:
        boolean boolean
      • isAllEmpty

        public static boolean isAllEmpty​(String... strings)
        Is all empty boolean.
        Parameters:
        strings - the strings
        Returns:
        boolean boolean
      • builder

        public static String builder​(String... values)
        Builder string.
        Parameters:
        values - the values
        Returns:
        string string
      • valueOf

        public static String valueOf​(Object value)
        Value of string.
        Parameters:
        value - the value
        Returns:
        string string
      • getHash

        public static String getHash​(String str,
                                     String algo)
        Gets hash.
        Parameters:
        str - the str
        algo - the algo
        Returns:
        hash hash
      • bytesToHex

        public static String bytesToHex​(byte[] hash)
        Bytes to hex string.
        Parameters:
        hash - the hash
        Returns:
        string string
      • repeat

        public static String repeat​(String str,
                                    int count)
        Repeat string.
        Parameters:
        str - the str
        count - the count
        Returns:
        string string
      • repeatAndJoin

        public static String repeatAndJoin​(String str,
                                           int count,
                                           String with)
        Repeat and join string.
        Parameters:
        str - the str
        count - the count
        with - the with
        Returns:
        string string
      • splitAndTrim

        public static String[] splitAndTrim​(String str,
                                            String regex)
        Split and trim string [ ].
        Parameters:
        str - the str
        regex - the regex
        Returns:
        string [ ]
      • replace

        public static String replace​(String str,
                                     String regex,
                                     String replacement)
        Replace string.
        Parameters:
        str - the str
        regex - the regex
        replacement - the replacement
        Returns:
        string string
      • join

        public static String join​(String delimiter,
                                  List<String> strs)
        Join string.
        Parameters:
        delimiter - the delimiter
        strs - the strs
        Returns:
        string string
      • join

        public static String join​(String delimiter,
                                  String... strs)
        Join string.
        Parameters:
        delimiter - the delimiter
        strs - the strs
        Returns:
        the string