GENERATE/PREV.gifGENERATE/NEXT.gif

String : Value

literal

"<characters>"

properties

<string>.count

number of characters in string

operators

<string> + <string>

return a new string that is the concatenation of the two strings

<string> == <string>

<string> != <string>

<string> > <string>

<string> < <string>

<string> >= <string>

<string> <= <string>

standard lexical string comparison (case sensitive)

<string>[]

return indexed character as a single-character string, index starts at 1.

<string>[] = <single_character_string>

set indexed character to character given

<string> as <name>

converts a string value into a name value using the as operator, for example:

    "foo" as name -> #foo

You can also convert strings to numbers using the as operator. For example:

x = "123.4" as float      -- returns 123.4

You can use any of the Number classes as a target class, Number, Float or Integer. If you use Number, the appropriate class will be used depending on the syntax of the number in the string.

methods

findString <string> <search_string>

returns index of search_string in string or undefined if not found

substring <string> <from_integer> <length_integer>

return indexed substring

The string method substring() returns a short string containing as many characters as are available in the source. For example:

s = "Balerofon"

ss = substring s 5 100      -> "rofon"

replace <string> <from_int> <length_int> <new_string>

replace indexed substring with new string. New string can be any length.