Next Previous Contents

48. isdigit

Synopsis

Tests for a decimal digit character

Usage

Integer_Type isdigit (String_Type s)

Description

This function returns a non-zero value if the first character in the string s is a digit; otherwise, it returns zero.

Example

A simple, user defined implementation of isdigit is

    define isdigit (s)
    {
       return ((s[0] <= '9') and (s[0]  >= '0'));
    }
However, the intrinsic function isdigit executes many times faster than the equivalent representation defined above.
Notes

Unlike the C function with the same name, the S-lang function takes a string argument.

See Also

int, integer


Next Previous Contents