Returns a copy of a given string with everything but its digits removed.


string_digits( str );

Argument Description
str The string to get the digits from.

Returns: String


You can use this function to parse a given string and get any numbers from it. For example, say you have this text - "I am 81 years old". With this function you would get a return string of "81".


var t_str;
t_str = string_digits(input_str);
age = real(t_str);

The above code will take the input string, strip it of all characters other than numbers and then set the variable "age" to hold the real number value of the return string.

Back: Strings
Next: string_format
© Copyright YoYo Games Ltd. 2018 All Rights Reserved