Colobot Wiki
Advertisement

Convert a string to a number. Don't confuse the string "45" that contains actually the two characters 4 and 5 and the number 45.

Examples:[]

string s = "45"+"12";  // s contains "4512"
float  n =  45 + 12;   // n contains 67

Syntax:

strval ( string );

Examples:[]

float n = strval("1.23");     // n is 1.23
float n = strval("12abc45");  // n is 12
float n = strval("abc");      // n is 0
float n = strval("100")+2;    // n is 102


See also[]

strlen, strleft, strright, strmid, strfind, strupper, strlower

Programming, types, and categories.

Advertisement