com.opensymphony.oscache.util
Class StringUtil

java.lang.Object
  extended by com.opensymphony.oscache.util.StringUtil

public class StringUtil
extends Object

Provides common utility methods for handling strings.

Author:
Chris Miller

Method Summary
static boolean hasLength(String s)
           
static boolean isEmpty(String s)
           
static List split(String str, char delimiter)
          Splits a string into substrings based on the supplied delimiter character.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

split

public static final List split(String str,
                               char delimiter)
Splits a string into substrings based on the supplied delimiter character. Each extracted substring will be trimmed of leading and trailing whitespace.

Parameters:
str - The string to split
delimiter - The character that delimits the string
Returns:
A string array containing the resultant substrings

hasLength

public static final boolean hasLength(String s)
Parameters:
s - the string to be checked
Returns:
true if the string parameter contains at least one element

isEmpty

public static final boolean isEmpty(String s)
Parameters:
s - the string to be checked
Returns:
true if the string parameter is null or doesn't contain any element
Since:
2.4

OSCache Project Page