C# Class ElizaCore.EString

Eliza string functions.
Eliza string functions.
Afficher le fichier Open project: xamarin/monotouch-samples Class Usage Examples

Méthodes publiques

Méthode Description
Amatch ( string str, string pat ) : int

Look for a match between the string and the pattern.

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 ( string s ) : string

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 ( string s, char c ) : int

Count number of occurrances of c in str

FindNum ( string str ) : int

Look for a number in the string.

Look for a number in the string. Return the number of digits at the beginning.

FindPat ( string str, string pat ) : int

Search in successive positions of the string, looking for a match to the pattern.

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 ( string str, string pat, string matches ) : bool
Pad ( string s ) : string

Pad by ensuring there are spaces before and after the sentence.

Pad by ensuring there are spaces before and after the sentence.

Translate ( string str, string src, string dest ) : string
Trim ( string s ) : string

Trim off leading space

Private Methods

Méthode Description
MatchA ( string str, string pat, string matches ) : bool

Match the string against a pattern and fills in matches array with the pieces that matched * and #

MatchB ( string strIn, string patIn, string matches ) : bool

Method Details

Amatch() public static méthode

Look for a match between the string and the pattern.
Look for a match between the string and the pattern. Return count of maching characters before * or #. Return -1 if strings do not match.
public static Amatch ( string str, string pat ) : int
str string
pat string
Résultat int

Compress() public static méthode

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 Compress ( string s ) : string
s string
Résultat string

Count() public static méthode

Count number of occurrances of c in str
public static Count ( string s, char c ) : int
s string
c char
Résultat int

FindNum() public static méthode

Look for a number in the string.
Look for a number in the string. Return the number of digits at the beginning.
public static FindNum ( string str ) : int
str string
Résultat int

FindPat() public static méthode

Search in successive positions of the string, looking for a match to the pattern.
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.
public static FindPat ( string str, string pat ) : int
str string
pat string
Résultat int

Match() public static méthode

public static Match ( string str, string pat, string matches ) : bool
str string
pat string
matches string
Résultat bool

Pad() public static méthode

Pad by ensuring there are spaces before and after the sentence.
Pad by ensuring there are spaces before and after the sentence.
public static Pad ( string s ) : string
s string
Résultat string

Translate() public static méthode

public static Translate ( string str, string src, string dest ) : string
str string
src string
dest string
Résultat string

Trim() public static méthode

Trim off leading space
public static Trim ( string s ) : string
s string
Résultat string