Ajocado API 1.0.0.Alpha2

org.jboss.arquillian.ajocado.utils
Class StringUtils

java.lang.Object
  extended by org.jboss.arquillian.ajocado.utils.StringUtils

public final class StringUtils
extends Object


Method Summary
static boolean isEmpty(String str)
           
static String replace(String text, String searchString, String replacement)
           
static String replace(String text, String searchString, String replacement, int max)
           
static String replaceOnce(String text, String searchString, String replacement)
           
static String[] split(String str, String separatorChars)
           Splits the provided text into an array, separators specified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

replace

public static String replace(String text,
                             String searchString,
                             String replacement)

replaceOnce

public static String replaceOnce(String text,
                                 String searchString,
                                 String replacement)

replace

public static String replace(String text,
                             String searchString,
                             String replacement,
                             int max)

isEmpty

public static boolean isEmpty(String str)

split

public static String[] split(String str,
                             String separatorChars)

Splits the provided text into an array, separators specified. This is an alternative to using StringTokenizer.

The separator is not included in the returned String array. Adjacent separators are treated as one separator. For more control over the split use the StrTokenizer class.

A null input String returns null. A null separatorChars splits on whitespace.

 StringUtils.split(null, *)         = null
 StringUtils.split("", *)           = []
 StringUtils.split("abc def", null) = ["abc", "def"]
 StringUtils.split("abc def", " ")  = ["abc", "def"]
 StringUtils.split("abc  def", " ") = ["abc", "def"]
 StringUtils.split("ab:cd:ef", ":") = ["ab", "cd", "ef"]
 

Parameters:
str - the String to parse, may be null
separatorChars - the characters used as the delimiters, null splits on whitespace
Returns:
an array of parsed Strings, null if null String input

Ajocado API 1.0.0.Alpha2

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.