isdigit


Description:

public bool isdigit ()

Determines whether a character is numeric (i.

e. a digit). This covers ASCII 0-9 and also digits in other languages/scripts. Given some UTF-8 text, obtain a character value with utf8_get_char.

Example: Determine whether a character is digit:

public static int main (string[] args) {
unichar[] chars = {'a', 'Ω', '0', '9',
'一', '二', '零','九'};

// Output: ``false false true true false false false false``
foreach (unichar c in chars) {
print ("%s ", c.isdigit ().to_string ());
}
print ("\n");
return 0;
}

valac --pkg glib-2.0 unichar.isdigit.vala

Parameters:

c

a Unicode character

Returns:

true if c is a digit