strToInt function


strToInt Integer

strToInt (String str)

Converts the string to an integer to ensure that subsequent operations operate on an integer rather than a string.

Parameters:

str - the string to convert.

Returns:

integer value of the string. If the string cannot be converted, zero i is returned. If the str is a boolean, 0 is returned if the value is false, 1 is returned if the value is true.

Example

num = strToInt('125')
// num is 125 (an integer value)

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*