Char.IsLetterOrDigit() Method in C#In this article, we will discuss the Char.IsLetterOrDigit() method in C# with syntax and examples. What is Char.IsLetterOrDigit() method?In C#, Char.IsLetterOrDigit() is a Char struct method that determines whether a Unicode character belongs to a character or decimal digit class. Unicode class members:There are several Unicode class members, including uppercase, lowercase, title characters, transition characters, new characters, and decimal digit numbers. This method can be overloaded by returning different numbers of arguments. Syntax: It has the following syntax: Where char c is the Unicode character to evaluate. Return Type: The return type of these methods is Boolean. If the method matches any Unicode letter or decimal digit, it returns True, and if the method does not match any Unicode letter or decimal digit, it returns False. Pseudocode: Program 1:Let us take an example to illustrate the Char.IsLetterOrDigit() method in C#. Output: Program 2:Let us take another example to illustrate the Char.IsLetterOrDigit() method in C#. Output: Another method that is used for the same process is Char.IsLetterOrDigit (String, Int) method. Char.IsLetterOrDigit (String, Int) method:The Char.IsLetterOrDigit (String, Int) method is method is used to determine whether a given string at a particular position matches a character or decimal place. It returns True value if it matches a character or decimal place, if it does not match, it will return false. Syntax: It has the following syntax: The parameters are, Str: It is the System's mandatory System.string type that has to be evaluated. Index: The character's position within the string that needs to be compared, and the parameter's type is System.Int32. The return type of this method is System.Boolean. If the method matches any letter or decimal digit at the given index in the given string, it returns True, if it does not match, it returns False. The exceptions for this method are,
Pseudocode: Program 1:Let us take an example to illustrate the Char.IsLetterOrDigit (String, Int) method in C#. Output: Program 2:Let us take another example to illustrate the Char.IsLetterOrDigit (String, Int) method in C#. Output: Advantages of Char.IsLetterOrDigit() method:There are several advantages of the Char.IsLetterOrDigit() method in C#. Some main advantages of the Char.IsLetterOrDigit() method are as follows:
Next TopicChar.ToUpperInvariant(Char) Method in C# |