Module Str
|
Function
|
Description
|
|
Compare(a: string, b: string): int
|
Returns -1, 0, +1 if a is less than, equal, or greater than b.
|
|
EndsWith(s: string, regexp: string): bool
|
Tests if a string ends with a particular pattern.
|
|
EqualsIgnoreCase(a: string, b: string): bool
|
Tests if a and b are equal in a case-insensitive manner.
|
|
IndexOf(pat: string, s: string): int
|
Returns the first position where pat occurs in s, otherwise -1.
|
|
LastIndexOf(pat: string, s: string): int
|
Returns the last position where pat occurs in s, otherwise -1.
|
|
Match(s: string, regexp: string): object
|
Tests whether s matches the regular expression regexp. If so, an object is returned where the fields of the object are integers numbered from 1 onwards, each of them having a value corresponding to the Perl5 groups (as indicated by the parenthesis sub-expressions in regexp) that has been matched. Nil is returned otherwise.
|
|
Replace(s: string, from: char, to: char): string
|
Replaces each occurrence of from with char in s.
|
|
Search(s: string, regexp: string): list
|
Searches for all the occurrences of the regular expression regexp in s, and returns a list of objects for each of them. The fields of the objects are similar to those returned by the Match function. Note that object field 0 is the complete matched character string.
|
|
Split(s: string, chars: string): list
|
Splits the string s at positions where any of the characters of chars appear. The function returns a list of strings.
|
|
StartsWith(s: string, regexp: string): bool
|
Tests if a string starts with a particular pattern.
|
|
ToLowerCase(s: string): string
|
Turns s into lowercase.
|
|
ToUpperCase(s: string): string
|
Turns s into uppercase.
|
|
Trim(s: string): string
|
Remove white space characters like new lines, carriage returns, tabs, etc. from the beginning and end of the argument string.
|