C# Класс ElizaCore.EString

Eliza string functions.
Eliza string functions.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

Amatch() публичный статический Метод

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
Результат int

Compress() публичный статический Метод

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
Результат string

Count() публичный статический Метод

Count number of occurrances of c in str
public static Count ( string s, char c ) : int
s string
c char
Результат int

FindNum() публичный статический Метод

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
Результат int

FindPat() публичный статический Метод

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
Результат int

Match() публичный статический Метод

public static Match ( string str, string pat, string matches ) : bool
str string
pat string
matches string
Результат bool

Pad() публичный статический Метод

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
Результат string

Translate() публичный статический Метод

public static Translate ( string str, string src, string dest ) : string
str string
src string
dest string
Результат string

Trim() публичный статический Метод

Trim off leading space
public static Trim ( string s ) : string
s string
Результат string