org.xwiki.gwt.user.client
Class StringUtils

java.lang.Object
  extended by org.xwiki.gwt.user.client.StringUtils

public class StringUtils
extends Object

Operations on Strings.

Version:
$Id: f23cf8d4253c3f5b1ad227fd630e03e7200ee3b0 $

Constructor Summary
protected StringUtils()
          Constructor.
 
Method Summary
static boolean areEqual(String expected, String actual)
           
static boolean isEmpty(String str)
          Check is a String is empty ("") or null.
static String join(Collection<?> collection, String inputSeparator)
          Joins the elements of the provided collection into a single string containing the provided elements.
static String substringAfterLast(String str, String pattern)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtils

protected StringUtils()
Constructor.

Method Detail

isEmpty

public static boolean isEmpty(String str)
Check is a String is empty ("") or null.

Parameters:
str - String to inspect.
Returns:
true if the string is empty or null, false otherwise.

substringAfterLast

public static String substringAfterLast(String str,
                                        String pattern)
Parameters:
str - the string to search in
pattern - the pattern to search in str
Returns:
the substring in str after the last occurrence of pattern, or the full str if pattern does not appear

areEqual

public static boolean areEqual(String expected,
                               String actual)
Parameters:
expected - the expected string
actual - the actual string
Returns:
true if the given strings are equal, false otherwise

join

public static String join(Collection<?> collection,
                          String inputSeparator)
Joins the elements of the provided collection into a single string containing the provided elements. No delimiter is added before or after the list. A null separator is the same as an empty string ("").

Parameters:
collection - the collection of values to join together, may be null
inputSeparator - the separator string to use, null treated as ""
Returns:
the joined string


Copyright © 2004-2012 XWiki. All Rights Reserved.