String routines

Top  Previous  Next

copy(<source>: string, <index>: integer, <count>: integer): string

returns substring containig <count> chars of <source> starting from <index> char.

<source> - string expression

<index>, <count> - integer expressions

 

pos(<source>: string, <substr>: string): integer

returns index of first occurance of <substr> in <source>

<source>, <substr> - string expressions

 

posex(<source>: string, <substr>: string, <index>: integer): integer

returns index of first occurance of <substr> in <source> starting search

at <index> char

<source>, <substr> - string expressions

<index> - integer expression

 

uppercase(<source>: string): string

returns string of uppercase characters of <source> string

<source> - string expression

 

lowercase(<source>: string): string

returns string of lowercase characters of <source> string

<source> - string expression

 

len(<array>): integer

returns length of array or string

<array> - array or string expression

 

setlen(<array>, <new_length>: integer)

sets length of dynamic array or string

<array> - dynamic array or string expression

<new_length> - integer expression

 

chr(<char>: integer): string

returns character of <char> ascii index

<char> - index of character in ascii table

 

ord(<char>: string): integer

returns ascii index of <char> character

<char> - string expression. first character is used

 

float_num(<number_str>: string): float

returns float number presented by <number_str>

<number_str> - numerical string expression

 

integer_num(<number_str>: string): integer

returns integer number presented by <number_str>

<number_str> - numerical string expression

 

function isnum(s: string): boolean - return true if first char of s string represents number

function isalpha(s: string): boolean - return true if first char of s string represents letter

function trim(s: string): string - returns s string without leading and trailing white spaces

 

function tostring(<number>): string - return string representation of <number>

function tostring(format: string, <number>): string

return formatted string representation of <number>

Specifier

Represents

0

Digit placeholder. If the value being formatted has a digit in the position where '0' appears in the format string, then that digit is copied to the output string. Otherwise, a '0' is stored in that position in the output string.

#

Digit placeholder. If the value being formatted has a digit in the position where '#' appears in the format string, then that digit is copied to the output string. Otherwise, nothing is stored in that position in the output string.

.

Decimal point. The first '.' character in the format string determines the location of the decimal separator in the formatted value; any additional '.' characters are ignored. The actual character used as a decimal separator in the output string is determined by the DecimalSeparator global variable or its TFormatSettings equivalent.

,

Thousand separator. If the format string contains one or more ',' characters, the output will have thousand separators inserted between each group of three digits to the left of the decimal point. The placement and number of ',' characters in the format string does not affect the output, except to indicate that thousand separators are wanted. The actual character used as a thousand separator in the output is determined by the ThousandSeparator global variable or its TFormatSettings equivalent.

E+

Scientific notation. If any of the strings 'E+', 'E-', 'e+', or 'e-' are contained in the format string, the number is formatted using scientific notation. A group of up to four '0' characters can immediately follow the 'E+', 'E-', 'e+', or 'e-' to determine the minimum number of digits in the exponent. The 'E+' and 'e+' formats cause a plus sign to be output for positive exponents and a minus sign to be output for negative exponents. The 'E-' and 'e-' formats output a sign character only for negative exponents.

'xx'/"xx"

Characters enclosed in single or double quotation marks are output as such and do not affect formatting.

;

Separates sections for positive, negative, and zero numbers in the format string.