O'Reilly logo

Learning WML, and WMLScript by Martin Frost

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

isInt — Test whether a string can be parsed as an integer

Usage

Lang.isInt(str)

str : String

Description

Returns true or false, depending on whether str can be parsed as an integer by Lang.parseInt( ). Returns invalid if str can’t be converted to a string.

Examples

Lang.isInt("17")

returns Boolean true

Lang.isInt("23.67")

returns Boolean true

Lang.isInt(" -63 percent")

returns Boolean true

Lang.isInt("+4inches")

returns Boolean true

Lang.isInt(true)

returns Boolean false

Lang.isInt(".3")

returns Boolean false

Lang.isInt("+")

returns Boolean false

Lang.isInt(invalid)

returns invalid

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required