String functions
The following functions deal with characters and strings.
Conversion
chr(val) Returns a string containing the character with ASCII code val. Valid arguments are integers from 0 to 255. Numbers outside this range are computed modulo 256. Fractions are rounded up or down to the nearest integer. ord(str) Returns the ASCII code of the first character in str. real(str) Turns str into a real number. str can contain a minus sign, a decimal dot and even an exponential part. If the argument given is a real it is passed unchanged and without error. This function does not work for hexadecimal strings (eg. "$89AB"). string(val) Turns the real value into a string using a standard format (no decimal places when it is an integer, and two decimal places otherwise). If the argument is already a string it is passed unchanged and without error. string_format(val,tot,dec) Turns val into a string using your own format: tot indicates the total number of places and dec indicates the number of decimal places.Manipulation
string_length(str) Returns the number of characters in the string. string_pos(substr,str) Returns the position of substr in str (0=no occurrence). string_copy(str,index,count) Returns a substring of str, starting at position index, and of length count. string_char_at(str,index) Returns the character in str at position index. string_delete(str,index,count) Returns a copy of str with the part removed that starts at position index and has length count. string_insert(substr,str,index) Returns a copy of str with substr added at position index. string_replace(str,substr,newstr) Returns a copy of str with the first occurrence of substr replaced by newstr. string_replace_all(str,substr,newstr) Returns a copy of str with all occurrences of substr replaced by newstr. string_count(substr,str) Returns the number of occurrences of substr in str. string_lower(str) Returns a lowercase copy of str. Has no effect on symbols, numerals, control codes or other non-letters. string_upper(str) Returns an uppercase copy of str. Has no effect on symbols, numerals, control codes or other non-letters. string_repeat(str,count) Returns a string consisting of count copies of str. string_letters(str) Returns a string that only contains the letters in str. Spaces, numerals, symbols, control codes, and all other non-letters will be removed. string_digits(str) Returns a string that only contains the digits in str. Spaces, letters, symbols, control codes, and all other non-numerals will be removed. string_lettersdigits(str) Returns a string that contains the letters and digits in str. Spaces, symbols, control codes, and all other non-alphanumeric characters will be removed.Clipboard functions
The following functions deal with the clipboard for storing text.
clipboard_has_text() Returns whether there is any text on the clipboard. clipboard_get_text() Returns the current text on the clipboard. clipboard_set_text(str) Sets the string str on the clipboard.
Contributors: Mark Overmars, xot
History:
Apr 5, 2007 - xot added a comment about using real() with hexadecimal numbers

Related: