Brooklyn

brooklyn.util
[Java] Class StringUtils

java.lang.Object
  brooklyn.util.StringUtils

public class StringUtils

Conveniences for manipulating strings.

Many of these are aligned with apache commons string utils, providing a lightweight variant of that project.

deprecated:
since 0.4.0 use Strings


Method Summary
static boolean isEmpty(java.lang.String s)

Checks if the given string is null or is an empty string.

static java.lang.String removeEnd(java.lang.String source, java.lang.String suffix)

removes the suffix from the end of the string, if present

static java.lang.String removeStart(java.lang.String source, java.lang.String prefix)

removes the prefix from the start of the string, if present

static java.lang.String replace(java.lang.String source, java.lang.String pattern, java.lang.String replacement)

replaces all instances in source, of the given pattern, with the given replacement (not interpreting any arguments as regular expressions)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Method Detail

isEmpty

public static boolean isEmpty(java.lang.String s)
Checks if the given string is null or is an empty string.
Parameters:
s - the String to check
Returns:
true if empty or null, false otherwise.


removeEnd

public static java.lang.String removeEnd(java.lang.String source, java.lang.String suffix)
removes the suffix from the end of the string, if present


removeStart

public static java.lang.String removeStart(java.lang.String source, java.lang.String prefix)
removes the prefix from the start of the string, if present


replace

public static java.lang.String replace(java.lang.String source, java.lang.String pattern, java.lang.String replacement)
replaces all instances in source, of the given pattern, with the given replacement (not interpreting any arguments as regular expressions)


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.