Class EString
package: net.jxta.myjxta.misc.eliza
public class EString
Eliza string functions.
Field Summary
final static String
   The digits.
 
Method Summary
public static int
amatch(String str, String pat)
   Look for a match between the string and the pattern.
 
public static String
compress(String s)
   Compresses its input by: dropping space before space, comma, and period; adding space before question, if char before is not a space; and copying all others
 
public static int
count(String s, char c)
   Count number of occurrances of c in str
 
public static int
findNum(String str)
   Look for a number in the string.
 
public static int
findPat(String str, String pat)
   Search in successive positions of the string, looking for a match to the pattern.
 
public static boolean
match(String str, String pat, String matches)
static boolean
matchA(String str, String pat, String matches)
   Match the string against a pattern and fills in matches array with the pieces that matched * and #
 
static boolean
matchB(String strIn, String patIn, String matches)
public static String
pad(String s)
   Pad by ensuring there are spaces before and after the sentence.
 
public static String
translate(String str, String src, String dest)
public static String
trim(String s)
   Trim off leading space
 
Field Detail
num
final static String num = "0123456789"
The digits.
Method Detail
amatch
public static int amatch(String str, String pat)
Look for a match between the string and the pattern. Return count of maching characters before * or #. Return -1 if strings do not match.

compress
public static String compress(String s)
Compresses its input by: dropping space before space, comma, and period; adding space before question, if char before is not a space; and copying all others

count
public static int count(String s, char c)
Count number of occurrances of c in str

findNum
public static int findNum(String str)
Look for a number in the string. Return the number of digits at the beginning.

findPat
public static int findPat(String str, String pat)
Search in successive positions of the string, looking for a match to the pattern. Return the string position in str of the match, or -1 for no match.

match
public static boolean match(String str, String pat, String matches)

matchA
static boolean matchA(String str, String pat, String matches)
Match the string against a pattern and fills in matches array with the pieces that matched * and #

matchB
static boolean matchB(String strIn, String patIn, String matches)

pad
public static String pad(String s)
Pad by ensuring there are spaces before and after the sentence.

translate
public static String translate(String str, String src, String dest)

trim
public static String trim(String s)
Trim off leading space