This documentation is archived and is not being maintained.

Char.IsLetterOrDigit Method

Indicates whether a Unicode character is categorized as an alphabetic letter or a decimal digit.

Overload List

Indicates whether the specified Unicode character is categorized as an alphabetic letter or a decimal digit.

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Public Shared Function IsLetterOrDigit(Char) As Boolean
[C#] public static bool IsLetterOrDigit(char);
[C++] public: static bool IsLetterOrDigit(__wchar_t);
[JScript] public static function IsLetterOrDigit(Char) : Boolean;

Indicates whether the character at the specified position in a specified string is categorized as an alphabetic character or a decimal digit.

[Visual Basic] Overloads Public Shared Function IsLetterOrDigit(String, Integer) As Boolean
[C#] public static bool IsLetterOrDigit(string, int);
[C++] public: static bool IsLetterOrDigit(String*, int);
[JScript] public static function IsLetterOrDigit(String, int) : Boolean;


[Visual Basic, C#, C++] The following sample demonstrates IsLetterOrDigit.

[Visual Basic, C#, C++] Note   This example shows how to use one of the overloaded versions of IsLetterOrDigit. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
imports System

Module IsLetterOrDigitSample

    Sub Main()

        Dim str As String
        str = "newline:" + vbNewLine

        Console.WriteLine(Char.IsLetterOrDigit("8"c))       ' Output: "True"
        Console.WriteLine(Char.IsLetterOrDigit(str, 8))     ' Output: "False", because it's a NewLine

    End Sub

End Module

using System;

public class IsLetterOrDigitSample {
    public static void Main() {
        string str = "newline:\n";

        Console.WriteLine(Char.IsLetterOrDigit('8'));        // Output: "True"
        Console.WriteLine(Char.IsLetterOrDigit(str, 8));    // Output: "False", because it's a newline

#using <mscorlib.dll>
using namespace System;

int main() {
   String* str = "newline:\n";

   Console::WriteLine(Char::IsLetterOrDigit('8'));      // Output: "True"
   Console::WriteLine(Char::IsLetterOrDigit(str, 8));   // Output: "False", because it's a newline

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

Char Structure | Char Members | System Namespace