javatools.util
Class StringUtils

java.lang.Object
  |
  +--javatools.util.StringUtils

public class StringUtils
extends java.lang.Object

Contains a set of function to manage string.


Constructor Summary
StringUtils()
          Creates new StringUtils
 
Method Summary
static java.lang.String proper(java.lang.String inString)
          Sets as upper case the first letter of each word (and lowers all the others).
static java.lang.String toSQLSearchString(java.lang.String inString)
          Removes extra spaces, replaces spaces with "%" and puts "%" at the beginning and at the end of the passed string.
static java.lang.String[] toTokenArray(java.lang.String inString)
          Tokenizes a string (using spaces as delimiters) and returns the tokens as an array.
static java.lang.String[] toTokenArray(java.lang.String inString, java.lang.String delim)
          Tokenizes a string (using a specified delimiter) and returns the tokens as an array.
static java.util.List toTokenList(java.lang.String inString)
          Tokenizes a string (using spaces as delimiters) and returns the tokens as a list.
static java.util.List toTokenList(java.lang.String inString, java.lang.String delim)
          Tokenizes a string (using a specified delimiter) and returns the tokens as a List.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtils

public StringUtils()
Creates new StringUtils

Method Detail

proper

public static java.lang.String proper(java.lang.String inString)
Sets as upper case the first letter of each word (and lowers all the others).

Parameters:
inString - The string to "properize".
Returns:
The "properized" string.

toSQLSearchString

public static java.lang.String toSQLSearchString(java.lang.String inString)
Removes extra spaces, replaces spaces with "%" and puts "%" at the beginning and at the end of the passed string. Useful in "LIKE" clauses.

Parameters:
inString - The string to be processed.
Returns:
The final string.

toTokenArray

public static java.lang.String[] toTokenArray(java.lang.String inString)
Tokenizes a string (using spaces as delimiters) and returns the tokens as an array.

Parameters:
inString - The string to be processed.
Returns:
The token array.

toTokenArray

public static java.lang.String[] toTokenArray(java.lang.String inString,
                                              java.lang.String delim)
Tokenizes a string (using a specified delimiter) and returns the tokens as an array.

Parameters:
inString - The string to be processed.
delim - The delimiter to be used.
Returns:
The token array.

toTokenList

public static java.util.List toTokenList(java.lang.String inString)
Tokenizes a string (using spaces as delimiters) and returns the tokens as a list.

Parameters:
inString - The string to be processed.
Returns:
The token list.

toTokenList

public static java.util.List toTokenList(java.lang.String inString,
                                         java.lang.String delim)
Tokenizes a string (using a specified delimiter) and returns the tokens as a List.

Parameters:
inString - The string to be processed.
delim - The delimiter to be used.
Returns:
The token list.