OCPsoft Common API 1.0.5.Final

org.ocpsoft.common.util
Class Strings

java.lang.Object
  extended by org.ocpsoft.common.util.Strings

public final class Strings
extends Object

Utility methods for manipulating String instances

Author:
Lincoln Baxter, III

Constructor Summary
Strings()
           
 
Method Summary
static boolean areEqual(String left, String right)
          Return true if the given String instances are equal, or if both String instances are null.
static boolean areEqualTrimmed(String left, String right)
          Return true if the given String instances are equal when outer whitespace is removed, or if both String instances are null.
static String capitalize(String input)
          Capitalize the given String: "input" -> "Input"
static boolean isNullOrEmpty(String string)
          Return true if the given String is null or is empty.
static boolean isTrue(String value)
          Return true if the given String equals "true", case insensitive; otherwise return false.
static String join(Collection<?> collection, String delimiter)
          Join a Collection of String instances using the given delimiter.
static String uncapitalize(String input)
          Uncapitalize the given String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Strings

public Strings()
Method Detail

areEqual

public static boolean areEqual(String left,
                               String right)
Return true if the given String instances are equal, or if both String instances are null.


areEqualTrimmed

public static boolean areEqualTrimmed(String left,
                                      String right)
Return true if the given String instances are equal when outer whitespace is removed, or if both String instances are null. (E.g.: " hello world " is equal to "hello world ")


capitalize

public static String capitalize(String input)
Capitalize the given String: "input" -> "Input"


isNullOrEmpty

public static boolean isNullOrEmpty(String string)
Return true if the given String is null or is empty.


isTrue

public static boolean isTrue(String value)
Return true if the given String equals "true", case insensitive; otherwise return false.


join

public static String join(Collection<?> collection,
                          String delimiter)
Join a Collection of String instances using the given delimiter.


uncapitalize

public static String uncapitalize(String input)
Uncapitalize the given String. (E.g.: "CamelCase" -> "camelCase")


OCPsoft Common API 1.0.5.Final

Copyright © 2012 OCPsoft. All Rights Reserved.