net.larsan.urd.util
Class StringUtils

java.lang.Object
  |
  +--net.larsan.urd.util.StringUtils

public class StringUtils
extends java.lang.Object

Some static string methods

Version:
Alpha-0.1 / 2002-10-06 21:37
Author:
Lars J. Nilsson

Constructor Summary
StringUtils()
           
 
Method Summary
static java.lang.String replaceAll(java.lang.String source, java.lang.String regexp, java.lang.String value, boolean isSimple)
          Replace all occurances of a regular expression with a string.
static java.lang.String[] tokenize(java.lang.String str, java.lang.String del)
          Tokenize a string using a string as a delimiter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtils

public StringUtils()
Method Detail

tokenize

public static java.lang.String[] tokenize(java.lang.String str,
                                          java.lang.String del)
Tokenize a string using a string as a delimiter. This method is an alias for split.

Parameters:
str - String to tokenize
del - String delimiter
Returns:
The tokenized string without delimiters

replaceAll

public static java.lang.String replaceAll(java.lang.String source,
                                          java.lang.String regexp,
                                          java.lang.String value,
                                          boolean isSimple)
                                   throws java.util.regex.PatternSyntaxException
Replace all occurances of a regular expression with a string. This method differs to the String.replaceAll in that it can treat the replacement value as a simple string instead of a proper regular expression string.

Parameters:
source - String to replace values in
regexp - Reguslar expression to search for
value - String to replace with
Returns:
A string with the regexp replaced for the value
Throws:
java.util.regex.PatternSyntaxException - On regexp syntax errors