string: String operations

This module provides operations dealing with string objects. The functions generally assume that strings are encoded in Unicode or a subset of Unicode such as ASCII or ISO Latin 1.

See also: The std::Str type provides many useful string operations. The std module also contains several basic operations and type constructors that can work with strings, such as Int, Chr and Ord. The re module supports pattern matching of strings using regular expressions.

Functions

IntToStr(int as Int, base as Int[, numFill as Int]) as Int
Convert an integer to a string representation in the specified base. If numFill is specified, pad the result with zeroes so that it contains at least numFill digits. Digit values greater than 9 are represented as letters from "a" to "z" such that "a" is 10, "b" is 11, etc. Valid values for base are from 2 to 36, inclusive. Examples:
IntToStr(6, 2)       -- Result: "110" (binary)
IntToStr(255, 16, 4) -- Result: "00ff" (hexadecimal)

See also: std::Int

ExpandTabs(str as Str[, tabSize as Int]) as Str
Return a copy of the string with all tab characters expanded into spaces. The default tab size is 8, and it can overridden by specifying the optional argument tabSize.
IsLetter(char as Str) as Boolean
Return a boolean indicating whether the argument is a letter. The argument must be a string of length 1. The function recognizes also non-Latin characters, including (but not limited to) Cyrillic, Greek, Chinese and Japanese characters used for representing words.
IsDigit(char as Str) as Boolean
Return a boolean indicating whether the argument is a digit. The argument must be a string of length 1. Only the characters 0, 1, ..., 9 are recognized.
IsWordChar(char as Str) as Boolean
Return a boolean indicating whether the argument is a word character, i.e. a letter or a digit. The argument must be a string of length 1.
IsSpace(char as Str) as Boolean
Return a boolean indicating whether the argument is a whitespace character such as a space, a tab or a line feed character. The argument must be a string of length 1.