org.codehaus.plexus.interpolation.util

Class StringUtils

public class StringUtils extends Object

Code here was swiped from plexus-utils' StringUtils class, so plexus-interpolation could be completely self-contained.

Version: $Id: StringUtils.java 7529 2008-07-20 20:24:21Z olamy $

Author: jdcasey

Method Summary
static StringcapitalizeFirstLetter(String data)
static Stringreplace(String text, String repl, String with)

Replace all occurances of a String within another String.

A null reference passed to this method is a no-op.

static Stringreplace(String text, String repl, String with, int max)

Replace a String with another String inside a larger String, for the first max values of the search String.

A null reference passed to this method is a no-op.

Method Detail

capitalizeFirstLetter

public static String capitalizeFirstLetter(String data)

replace

public static String replace(String text, String repl, String with)

Replace all occurances of a String within another String.

A null reference passed to this method is a no-op.

Parameters: text text to search and replace in repl String to search for with String to replace with

Returns: the text with any replacements processed

See Also: StringUtils

replace

public static String replace(String text, String repl, String with, int max)

Replace a String with another String inside a larger String, for the first max values of the search String.

A null reference passed to this method is a no-op.

Parameters: text text to search and replace in repl String to search for with String to replace with max maximum number of values to replace, or -1 if no maximum

Returns: the text with any replacements processed

Copyright © 2001-2009 Codehaus. All Rights Reserved.