ParseInteger

See also: Math for information of the "Math" class.

See also: Strings for information of the "Strings" class.

usage:

ParseInteger("numerical String", Minimum value, [optional max value], [optional string end value])

Returns a number found in a string if the number meets all the criteria (more than or equal to min, less than or equal to max [if specified], and ending in string end value [if specified]). This could be used to extract a number from a string.

examples:

echo ParseInteger("40", 50)

Will return: 40 because it found the number 40 in the string and the number is less than 50.

echo ParseInteger("40s", 0, 40, "s")

Will return: 40 because it found a number 40 in the string, the number 40 is more than 0 but less than or equal to 40 and ends in "s".

echo ParseInteger("50s", 0, 100)

Will return: -1 because the string is not a number


CategoryFunctions

ParseInteger (last edited 2015-11-07 01:46:30 by LKD70)