org.apache.maven.util
Class StringTool

java.lang.Object
  extended byorg.apache.maven.util.StringTool

public class StringTool
extends java.lang.Object

Version:
$Id: StringTool.java 517014 2007-03-11 21:15:50Z ltheussl $
Author:
Ben Walding
To Do:
move to org.apache.maven.util or make a jelly tag

Constructor Summary
StringTool()
           
 
Method Summary
 java.util.List splitStringAtLastDelim(java.lang.String s, java.lang.String delim)
          Splits a string at the last delimiter.
static java.lang.String trim(java.lang.String s)
          Removes all whitespace characters from the start and end of a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringTool

public StringTool()
Method Detail

splitStringAtLastDelim

public java.util.List splitStringAtLastDelim(java.lang.String s,
                                             java.lang.String delim)
Splits a string at the last delimiter. If no delimiter is found, first element is the string, second element is empty string.

Parameters:
s - the string to be split
delim - the delimiter
Returns:
String[] a two element array, element 0 = string up to last delim (exclusive), element 1 = string past last delim (exclusive)

trim

public static java.lang.String trim(java.lang.String s)

Removes all whitespace characters from the start and end of a String.

This is similar to trim(String) but removes whitespace. Whitespace is defined by Character.isWhitespace(char).

Parameters:
s - the String to remove characters from, may be null
Returns:
the trimmed String, null if null String input


Copyright © 2001-2008 Apache Software Foundation. All Rights Reserved.