Isdigit c что это
In C#, Char.IsDigit() is a System.Char struct method which is used to check whether a Unicode character can be categorized as a decimal digit(radix 10) or not. Valid digits will be the members of the UnicodeCategory.DecimalDigitNumber category. This method can be overloaded by passing different type and number of arguments to it.
- Char.IsDigit(Char) Method
- Char.IsDigit(String, Int32) Method
Char.IsDigit(Char) Method
This method is used to check whether the specified Unicode character matches decimal digit or not. If it matches then it returns True otherwise return False.
Syntax:
Parameter:
ch: It is required Unicode character of System.char type which is to be checked.
Return Type: The method returns True, if it successfully matches any decimal digit, otherwise returns False. The return type of this method is System.Boolean.
Example:
Char.IsDigit(String, Int32) Method
This method is used to check whether the specified string at specified position matches with any decimal digit or not. If it matches then it returns True otherwise returns False.
Функция isdigit
Функция isdigit проверяет аргумент, передаваемый через параметр сharacter , является ли он десятичной цифрой.
Подробно ознакомиться с возвращаемыми результатами функций, для каждого символа стандартного набора символов ASCII вы можете в библиотек ctype.h.
В С++ локализованная версия функции isdigit определена в заголовочном файле <locale>.
Параметры:
- character
Символ для проверки, передается в функцию как значение типа int , или EOF .
Возвращаемое значение
Значение, отличное от нуля (т.е. истинно), если аргумент функции — это десятичная цифра .
Ноль (т.е. ложь), в противном случае.
Пример: исходный код программы
Пример работы программы
Функция isdigit используется для проверки первого символа в строке str , и, если это цифра, вызывается функция atoi , которая преобразует этот символ в значение типа int .
C Language: isdigit function
(Test for Digit)
In the C Programming Language, the isdigit function tests whether c is a digit.
Syntax
The syntax for the isdigit function in the C Language is:
Parameters or Arguments
Returns
The isdigit function returns a nonzero value if c is a digit and returns zero if c is not a digit.
Required Header
In the C Language, the required header for the isdigit function is:
Applies To
In the C Language, the isdigit function can be used in the following versions:
- ANSI/ISO 9899-1990
isdigit Example
When compiled and run, this application will output:
Similar Functions
Other C functions that are similar to the isdigit function:
See Also
Other C functions that are noteworthy when dealing with the isdigit function:
isdigit
Проверяет, является ли данный символ числовым ( 0123456789 ).
Поведение не определено, если значение ch не может быть представлено как unsigned char и не равно EOF .
Parameters
| ch | — | характер классификации |
Return value
Ненулевое значение,если символ является числовым,ноль в противном случае.
Notes
isdigit и isxdigit являются единственными стандартными функциями классификации узких символов, на которые не влияет установленный в настоящее время языковой стандарт C, хотя некоторые реализации (например, Microsoft в кодовой странице 1252) могут классифицировать дополнительные однобайтовые символы как цифры.