previous contents index next
(Functions..) Contents Index (..Functions..)

2.8.2 String Functions (StringFunctionCall)

StringFunctionCall - Syntax:

Syntax: StringFunctionCall
 
scopy( StringExpression , IntExpression1 , IntExpression2 )
returns a substring of StringExpression starting at the position given by IntExpression1. (Note that we find the first character in a string at position 0.)
IntExpression2 >= 0 represents the length of the substring. Make sure that it is still completely part of the string; more precise,

IntExpression1 + IntExpression2 <= len(StringExpression)

must be satisfied.

Example 21:


scopy("state 13",6,2)    leadsto  13
scopy("1234567890",3,1)   leadsto  4

 
itos( IntExpression )
converts IntExpression into a string constant. Leading zeros in IntExpression are not allowed.

Example 22:

itos(-10203) leadsto "-10203"

Suppose that str is a string variable with contents "3 happy corners of a triangle".

itos(stoi(str)-1) + " corners?!" leadsto "2 corners?!"

previous contents index next
(Functions..) Contents Index (..Functions..)