org.jpu.patterns.common
Class JPUStringUtils

java.lang.Object
  extended byorg.jpu.patterns.common.JPUStringUtils

public class JPUStringUtils
extends java.lang.Object


Method Summary
static java.util.List split(java.lang.String str, java.lang.String delim)
          Equivalent to split(str, delim, true).
static java.util.List split(java.lang.String str, java.lang.String delim, boolean trim)
          This method is like org.apache.commons.lang.StringUtils.split(), except for two differences: 1) Its return value is List instead of String[], and 2) it gives you the option of trimming each component before it is added to the list.
static java.util.List splitN(java.lang.String str, java.lang.String delim, int n, boolean trim)
          Just like split(String,String,boolean), except that only the leftmost "n-1" delimeted parts are split; the rest are left contiguous.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

split

public static java.util.List split(java.lang.String str,
                                   java.lang.String delim)
Equivalent to split(str, delim, true).


splitN

public static java.util.List splitN(java.lang.String str,
                                    java.lang.String delim,
                                    int n,
                                    boolean trim)
Just like split(String,String,boolean), except that only the leftmost "n-1" delimeted parts are split; the rest are left contiguous.

Parameters:
str - The string.
delim - The delimeter.
n - The maximum number of parts that will appear in the resulting List. If less than 2, the resulting list will contain exactly one element set to the entire original string "str".
trim - Indicates whether to trim each part before adding it to the resulting List.

split

public static java.util.List split(java.lang.String str,
                                   java.lang.String delim,
                                   boolean trim)
This method is like org.apache.commons.lang.StringUtils.split(), except for two differences: 1) Its return value is List instead of String[], and 2) it gives you the option of trimming each component before it is added to the list.



Copyright (c) 2001-2003 - Apache Software Foundation