Find the numeric value of a string.


strval( const string[], index=0 )

strval will evaluate all digits starting at the index position until it encounters a non-digit.


string The buffer to be evaluated
index The offset in the buffer to start looking for a number.

Return value

The value in the string.
Returns 0 if the string starting at the index did not start with a valid number.

Example usage

    new x;
    new s{20} = "Cat47";
    x = strval(s, 3); 
    // x is now 47
  • ezeio2/scriptref/strval.txt
  • Last modified: 2019-09-02 21:45
  • by andreh