org.apache.cocoon.util
Class StringUtils
java.lang.Object
|
+--org.apache.cocoon.util.StringUtils
- public class StringUtils
- extends java.lang.Object
A collection of String
handling utility methods.
- Version:
- CVS $Id: StringUtils.java,v 1.4 2002/02/22 07:03:57 cziegeler Exp $
- Author:
- Ricardo Rocha, Stefano Mazzocchi
Method Summary |
static int |
count(java.lang.String str,
char c)
Counts the occurrence of the given char in the string. |
static boolean |
isAlphaNumeric(char c)
Tests whether a given character is alphabetic, numeric or
underscore |
static int |
matchStrings(java.lang.String a,
java.lang.String b)
Matches two strings. |
static java.lang.String |
replaceToken(java.lang.String s)
Replaces tokens in input with Value present in System.getProperty |
static java.lang.String[] |
split(java.lang.String line)
Split a string as an array using whitespace as separator |
static java.lang.String[] |
split(java.lang.String line,
java.lang.String delimiter)
Split a string as an array using a given set of separators |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StringUtils
public StringUtils()
split
public static java.lang.String[] split(java.lang.String line)
- Split a string as an array using whitespace as separator
- Parameters:
line
- The string to be split- Returns:
- An array of whitespace-separated tokens
split
public static java.lang.String[] split(java.lang.String line,
java.lang.String delimiter)
- Split a string as an array using a given set of separators
- Parameters:
line
- The string to be splitdelimiter
- A string containing token separators- Returns:
- An array of token
isAlphaNumeric
public static boolean isAlphaNumeric(char c)
- Tests whether a given character is alphabetic, numeric or
underscore
- Parameters:
c
- The character to be tested- Returns:
- whether the given character is alphameric or not
count
public static int count(java.lang.String str,
char c)
- Counts the occurrence of the given char in the string.
- Parameters:
str
- The string to be testedc
- the char to be counted- Returns:
- the occurrence of the character in the string.
matchStrings
public static int matchStrings(java.lang.String a,
java.lang.String b)
- Matches two strings.
- Parameters:
a
- The first stringb
- The second string- Returns:
- the index where the two strings stop matching starting from 0
replaceToken
public static java.lang.String replaceToken(java.lang.String s)
- Replaces tokens in input with Value present in System.getProperty
Copyright � 1999-2002 Apache Software Foundation. All Rights Reserved.