Class StringUtil


  • public final class StringUtil
    extends Object
    String utility class.
    • Field Detail

      • NEWLINE

        public static final String NEWLINE
    • Method Detail

      • stripControlCharacters

        public static String stripControlCharacters​(Object value)
        Strip an Object of it's ISO control characters.
        Parameters:
        value - The Object that should be stripped. This objects toString method will called and the result passed to stripControlCharacters(String).
        Returns:
        String A new String instance with its hexadecimal control characters replaced by a space. Or the unmodified String if it does not contain any ISO control characters.
      • stripControlCharacters

        public static String stripControlCharacters​(String value)
        Strip a String of it's ISO control characters.
        Parameters:
        value - The String that should be stripped.
        Returns:
        String A new String instance with its hexadecimal control characters replaced by a space. Or the unmodified String if it does not contain any ISO control characters.
      • split

        public static String[] split​(String value,
                                     char delim)
        Splits the specified String with the specified delimiter. This operation is a simplified and optimized version of String.split(String).
      • split

        public static String[] split​(String value,
                                     char delim,
                                     int maxParts)
        Splits the specified String with the specified delimiter in maxParts maximum parts. This operation is a simplified and optimized version of String.split(String, int).
      • substringAfter

        public static String substringAfter​(String value,
                                            char delim)
        Get the item after one char delim if the delim is found (else null). This operation is a simplified and optimized version of String.split(String, int).