Class StringUtils


  • public final class StringUtils
    extends java.lang.Object

    Common java.lang.String manipulation routines.


    Originally from Turbine and the GenerationJavaCore library.


    NOTE: This class is not part of any api and is public purely for technical reasons !
    Since:
    1.0
    Version:
    $Id: StringUtils.java 8001 2009-01-03 13:17:09Z vsiveton $
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String NL  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private StringUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isBlank​(java.lang.String str)
      Checks if a (trimmed) String is null or blank.
      static boolean isNotBlank​(java.lang.String str)
      Checks if a (trimmed) String is not null and not blank.
      static java.lang.String[] split​(java.lang.String text, java.lang.String separator)  
      static boolean startsWith​(java.lang.StringBuffer buffer, java.lang.String pattern)
      Determines if buffer starts with specific literal(s).
      • Methods inherited from class java.lang.Object

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

      • NL

        public static final java.lang.String NL
    • Constructor Detail

      • StringUtils

        private StringUtils()
    • Method Detail

      • split

        public static java.lang.String[] split​(java.lang.String text,
                                               java.lang.String separator)
      • isBlank

        public static boolean isBlank​(java.lang.String str)

        Checks if a (trimmed) String is null or blank.

        Parameters:
        str - the String to check
        Returns:
        true if the String is null, or length zero once trimmed
      • isNotBlank

        public static boolean isNotBlank​(java.lang.String str)

        Checks if a (trimmed) String is not null and not blank.

        Parameters:
        str - the String to check
        Returns:
        true if the String is not null and length of trimmed str is not zero.
      • startsWith

        public static boolean startsWith​(java.lang.StringBuffer buffer,
                                         java.lang.String pattern)
        Determines if buffer starts with specific literal(s).
        Parameters:
        buffer - Examined StringBuffer
        pattern - a pattern which should start in buffer
        Returns:
        true if buffer's literal starts with given pattern, or both are empty.