isInt

boolean sutil.isInt ( String string )

Description

Determine if the value of a string is an integer.

Parameters

  • obj Object to be tested for containing an integer.

Return Values

Returns true if the string is an integer; otherwise, it returns false. If it is passed an object that is not a string, including an integer, an error will be thrown.

Change Log

Version Description
5.0 Added for all editions.

Examples

Check String Value

 // Does the GUESTS variable contain an integer
 if ( !sutil.isInt( session.getv( "GUESTS" ) ) )
 {
     session.logWarn( "Could not get the number of guests!" );
 }