Class StringUtil


  • public abstract class StringUtil
    extends Object
    Author:
    Philipp Meinen
    • Field Detail

      • EMPTY_STRING_ARRAY

        public static final String[] EMPTY_STRING_ARRAY
    • Constructor Detail

      • StringUtil

        protected StringUtil()
    • Method Detail

      • extractBack

        public static String extractBack​(String s,
                                         char delim)
      • count

        public static int count​(String str,
                                int value)
        Counts the number of times the character with the given unicode value occurs.
        Parameters:
        str - the input string, may be null or empty
        value - the unicode value to search for
        Returns:
        the number of times the given unicode value occurs.
      • split

        public static String[] split​(String str,
                                     int delimiter)
        Splits a string by a given unicode delimiter.
        Parameters:
        str - the input string, may be null or empty
        delimiter - the delimiter to use
        Returns:
        A string array with the different parts of the string after splitting it. The returned array is never null but may be empty (length 0). However, none of the returned values is empty.