Checking Whether
the Conversion of a String into an Integer is Possible: isInt()
Function

The
isInt() function is used to
check whether the conversion of a string into an integer is possible.
The actual conversion should be done by the parseInt()
function, which will be
described in the next section.

The
syntax of isInt() is:

Lang.isInt(string);

isInt()
returns true if string
can be converted into the integer type, otherwise it returns false.
If there are any errors, the function returns invalid.
The + (optional) and -
character are used to represent positive and negative values
respectively.

The
following WMLScript example demonstrates the behavior of the isInt()
function:

After
executing the above script, the variables u
to x have the Boolean
value true while y
and z have the Boolean
value false.

Note
that if the WMLScript
interpreter encounters a non-numeric character in string,
it will check if the characters before the non-numeric character form
a valid integral value. If yes, the isInt()
function will still return true,
like this:

What do you think about this web page? It is very helpful. It is helpful, but some information I wanted is missing. It is not helpful. It has broken links. It has typos / grammatical mistakes. It has incorrect information. Others

(Optional) Please provide us more details. For example, suppose you select option 2 above, can you tell us specifically what information is missing? You can also suggest anything that can help us improve this web page.

(Optional) Your name:

(Optional) Your email address:

Due to the amount of messages we received, we may not be able to reply to all messages.