All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class websphinx.util.Str

java.lang.Object
   |
   +----websphinx.util.Str

public abstract class Str
extends Object
String utility routines.


Constructor Index

 o Str()

Method Index

 o escape(String, char, String)
Escapes metacharacters in a string.
 o indexOfAnyChar(String, String)
Find first occurence of any of a set of characters.
 o indexOfAnyChar(String, String, int)
Find first occurence of any of a set of characters, starting at a specified index.
 o main(String[])
 o parseNumber(String)
 o replace(String, String, String)
Replace all occurences of a string.

Constructors

 o Str
 public Str()

Methods

 o indexOfAnyChar
 public static int indexOfAnyChar(String subject,
                                  String chars)
Find first occurence of any of a set of characters.

Parameters:
subject - String in which to search
chars - Characters to search for
Returns:
index of first occurence in subject of a character from chars, or -1 if no match.
 o indexOfAnyChar
 public static int indexOfAnyChar(String subject,
                                  String chars,
                                  int start)
Find first occurence of any of a set of characters, starting at a specified index.

Parameters:
subject - String in which to search
chars - Characters to search for
start - Starting offset to search from
Returns:
index of first occurence (after start) in subject of a character from chars, or -1 if no match.
 o replace
 public static String replace(String subject,
                              String original,
                              String replacement)
Replace all occurences of a string.

Parameters:
subject - String in which to search
original - String to search for in subject
replacement - String to substitute
Returns:
subject with all occurences of original replaced by replacement
 o escape
 public static String escape(String subject,
                             char escapeChar,
                             String metachars)
Escapes metacharacters in a string.

Parameters:
subject - String in which metacharacters are to be escaped
escapeChar - the escape character (e.g., \)
metachars - the metacharacters that should be escaped
Returns:
subject with escapeChar inserted before every character found in metachars
 o parseNumber
 public static Number parseNumber(String s) throws NumberFormatException
 o main
 public static void main(String args[])

All Packages  Class Hierarchy  This Package  Previous  Next  Index