Char.IsLetterOrDigit Method (Char)

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

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

'Declaration
Public Shared Function IsLetterOrDigit ( _
	c As Char _
) As Boolean

Parameters

c
Type: System.Char

The Unicode character to evaluate.

Return Value

Type: System.Boolean
true if c is a letter or a decimal digit; otherwise, false.

Valid letters and decimal digits are members of the following categories in UnicodeCategory: UppercaseLetter, LowercaseLetter, TitlecaseLetter, ModifierLetter, OtherLetter, or DecimalDigitNumber.

The following code example demonstrates IsLetterOrDigit.

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

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

XNA Framework

Supported in: 3.0, 2.0, 1.0

Portable Class Library

Supported in: Portable Class Library

Supported in: Windows Phone 8.1

Supported in: Windows Phone Silverlight 8.1

Supported in: Windows Phone Silverlight 8
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2015 Microsoft