com.waveset.util
Class StringUtil

java.lang.Object
  extended bycom.waveset.util.StringUtil

public class StringUtil
extends java.lang.Object

String utilities..


Constructor Summary
StringUtil()
           
 
Method Summary
static int indexOf(java.lang.String src, char[] ch)
           
static int indexOf(java.lang.String src, char[] ch, int idx)
           
static int indexOfDigit(java.lang.String str)
          Finds the index of the first digit.
static int indexOfDigit(java.lang.String str, int startidx)
          Finds the index of the first digit and starts from the index specified.
static int indexOfIgnoreCase(java.lang.String src, java.lang.String cmp)
          Finds the start index of the comparison string regards of case.
static int indexOfNonDigit(java.lang.String str)
          Finds the index of the first non digit.
static int indexOfNonDigit(java.lang.String str, int startidx)
          Finds the index of the first non digit and starts from the index specified.
static boolean isBlank(java.lang.String val)
           StringUtil.isBlank(null) = true StringUtil.isBlank("") = true StringUtil.isBlank(" ") = true StringUtil.isBlank("bob") = false StringUtil.isBlank(" bob ") = false
static boolean isEmpty(java.lang.String val)
           StringUtil.isEmpty(null) = true StringUtil.isEmpty("") = true StringUtil.isEmpty(" ") = false StringUtil.isEmpty("bob") = false StringUtil.isEmpty(" bob ") = false
static boolean isNotBlank(java.lang.String val)
           
static boolean isNotEmpty(java.lang.String val)
           
static java.lang.String stripNewlines(java.lang.String src)
          Removes newline characters (0x0a and 0x0d) from a string.
static java.lang.String stripXmlAttribute(java.lang.String src, java.lang.String attrName)
          Removes the attribute from the source string and returns.
static java.lang.String stripXmlComments(java.lang.String src)
          Strip Xml comments
static java.lang.String subDigitString(java.lang.String str)
          Return the string of digits from string.
static java.lang.String subDigitString(java.lang.String str, int idx)
          Return the string of digits from string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtil

public StringUtil()
Method Detail

indexOfDigit

public static int indexOfDigit(java.lang.String str,
                               int startidx)
Finds the index of the first digit and starts from the index specified.

Parameters:
str - String to seach for a digit.
startidx - Starting index from which to search
Returns:
-1 if not found otherwise the index.

indexOfDigit

public static int indexOfDigit(java.lang.String str)
Finds the index of the first digit.

Parameters:
str - String to seach for a digit.
Returns:
-1 if not found otherwise the index.

indexOfNonDigit

public static int indexOfNonDigit(java.lang.String str,
                                  int startidx)
Finds the index of the first non digit and starts from the index specified.

Parameters:
str - String to seach for a non digit.
startidx - Starting index from which to search.
Returns:
-1 if not found otherwise the index.

indexOfNonDigit

public static int indexOfNonDigit(java.lang.String str)
Finds the index of the first non digit.

Parameters:
str - String to seach for a non digit.
Returns:
-1 if not found otherwise the index.

subDigitString

public static java.lang.String subDigitString(java.lang.String str)
Return the string of digits from string.

Parameters:
str - Source string to search.

subDigitString

public static java.lang.String subDigitString(java.lang.String str,
                                              int idx)
Return the string of digits from string.

Parameters:
str - Source string to search.
idx - Start index from which to search.

stripXmlAttribute

public static java.lang.String stripXmlAttribute(java.lang.String src,
                                                 java.lang.String attrName)
Removes the attribute from the source string and returns.


stripNewlines

public static java.lang.String stripNewlines(java.lang.String src)
Removes newline characters (0x0a and 0x0d) from a string.


indexOfIgnoreCase

public static int indexOfIgnoreCase(java.lang.String src,
                                    java.lang.String cmp)
Finds the start index of the comparison string regards of case.

Parameters:
src - String to search.
cmp - Comparsion string to find.
Returns:
-1 if not found otherwise the index of the starting character.

stripXmlComments

public static java.lang.String stripXmlComments(java.lang.String src)
Strip Xml comments


indexOf

public static int indexOf(java.lang.String src,
                          char[] ch)

indexOf

public static int indexOf(java.lang.String src,
                          char[] ch,
                          int idx)

isEmpty

public static boolean isEmpty(java.lang.String val)
  StringUtil.isEmpty(null)               = true
  StringUtil.isEmpty("")       = true
  StringUtil.isEmpty(" ")      = false
  StringUtil.isEmpty("bob")    = false
  StringUtil.isEmpty(" bob ")  = false
 


isNotEmpty

public static boolean isNotEmpty(java.lang.String val)

isBlank

public static boolean isBlank(java.lang.String val)
      StringUtil.isBlank(null)                = true
      StringUtil.isBlank("")        = true
      StringUtil.isBlank(" ")       = true
      StringUtil.isBlank("bob")     = false
      StringUtil.isBlank("  bob  ") = false
 


isNotBlank

public static boolean isNotBlank(java.lang.String val)