Strings are delimited by double quotes, as in "string". For example:
Strings can be concatenated with the '+' operator. For example:
stores "myfilename" in the variable name, and
stores "myfilename.112" in newname Special characters are \n
for newline, \t for tab, \\ for \, and \"
for ".
The operator % converts braced <expression> into a
string. Example:
prints 3.
Example 1:
prints: 345678
Example 2:
prints 234689
Copy a (sub)-string into a sub-string
Example 3:
prints 1a3456789
Example 4:
prints 1abc56789
Example 5:
prints 1abcd6789
Example 6:
prints 1abcdefghijklm
Example 7:
prints 123456789 a
Example 8:
prints 1
a
The function index gives the first starting position of the sub-string
<sub-string>
in the string <string>. If <sub-string> does not match
any part of <string>, -1 is returned.Example:
returns 3 into the variable i
The function lastindex gives the last starting position of the
sub-string <sub-string> in the string <string>. If
<sub-string>
does not match any part of <string>, -1 is returned.Example:
returns "myfile" into the variable "name"
The function upcase converts the string <string> in
upper case characters. Example:
prints: ABCDE
The function lowcase converts the string <string> in lower case characters. Example:
prints: abcde
Returns the number of characters in <string>.
The function trim removes white space ( \n \r \t and ' ' ) at
the end of the string <string>. Example:
prints: abcdefg
The function f2ascii converts a float or array ( of floats ) into an ascii string. All bytes of the float(s) are returned as characters in the string if they represent a printable 7bits ascii character. Otherwise they are replaced by spaces. Each float produces a 4-character string-part.
Example 1:
prints A000 Example 2:
prints ##TITLE=
<value> = token { <inputstring> , } <delimiter>This is an implementation of C's strtok(), that can parse <inputstring> into tokens. The first call to token is with two arguments, an input string and a delimiter, and the first token is returned in <value> . For all further calls only one argument is used, the delimiter, and the next token is returned. The delimiter may be different for each call. If no more tokens are available, an empty string is returned. Unlike in C, the input string is not destroyed.
Example 1:
%line = " abc 1234; ok;twelve eleven;1.99"prints%bla = token %line, " ;"
while %bla != "" do
println %bla
%bla = token " ;"
doneabc
1234
ok
twelve
eleven
1.99