Main Index : Reference :

isdigit()


Description

Tells if a character is a digit or not.

Definition

[bool] isdigit([int] char)

Parameters

char is the character, given in 16 bit Unicode.

Return Value

isdigit() returns TRUE if char is a digit. Otherwise it returns FALSE.

Example

// Outputs "isdigit(5) = 1
//          isdigit(a) = 0
//          isdigit( ) = 0
//          isdigit(!) = 0".

println("isdigit(5) = ",isdigit("5"[0]));
println("isdigit(a) = ",isdigit("a"[0]));
println("isdigit( ) = ",isdigit(" "[0]));
println("isdigit(!) = ",isdigit("!"[0]));

See Also

isalpha(), isalnum(), isspace(), ispunct()