Char.IsLetterOrDigit Metoda
Definicja
Wskazuje, czy znak Unicode jest kategoryzowany jako litera czy cyfra dziesiętna.Indicates whether a Unicode character is categorized as a letter or a decimal digit.
Przeciążenia
IsLetterOrDigit(Char) |
Wskazuje, czy określony znak Unicode jest kategoryzowany jako litera czy cyfra dziesiętna.Indicates whether the specified Unicode character is categorized as a letter or a decimal digit. |
IsLetterOrDigit(String, Int32) |
Wskazuje, czy znak w określonym położeniu w określonym ciągu jest kategoryzowany jako litera, czy cyfra dziesiętna.Indicates whether the character at the specified position in a specified string is categorized as a letter or a decimal digit. |
Przykłady
Poniższy przykład kodu demonstruje IsLetterOrDigit .The following code example demonstrates IsLetterOrDigit.
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
}
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
}
}
Module IsLetterOrDigitSample
Sub Main()
Dim str As String
str = "newline:" + Environment.NewLine
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
Uwagi
Prawidłowe litery i cyfry dziesiętne są elementami członkowskimi następujących kategorii w UnicodeCategory : UppercaseLetter
,,,, LowercaseLetter
TitlecaseLetter
ModifierLetter
OtherLetter
lub DecimalDigitNumber
.Valid letters and decimal digits are members of the following categories in UnicodeCategory: UppercaseLetter
, LowercaseLetter
, TitlecaseLetter
, ModifierLetter
, OtherLetter
, or DecimalDigitNumber
.
IsLetterOrDigit(Char)
Wskazuje, czy określony znak Unicode jest kategoryzowany jako litera czy cyfra dziesiętna.Indicates whether the specified Unicode character is categorized as a letter or a decimal digit.
public:
static bool IsLetterOrDigit(char c);
public static bool IsLetterOrDigit (char c);
static member IsLetterOrDigit : char -> bool
Public Shared Function IsLetterOrDigit (c As Char) As Boolean
Parametry
- c
- Char
Znak Unicode do oceny.The Unicode character to evaluate.
Zwraca
true
Jeśli c
jest literą lub cyfrą dziesiętną; w przeciwnym razie false
.true
if c
is a letter or a decimal digit; otherwise, false
.
Uwagi
Prawidłowe litery i cyfry dziesiętne są elementami członkowskimi następujących kategorii w UnicodeCategory : UppercaseLetter
,,,, LowercaseLetter
TitlecaseLetter
ModifierLetter
OtherLetter
lub DecimalDigitNumber
.Valid letters and decimal digits are members of the following categories in UnicodeCategory: UppercaseLetter
, LowercaseLetter
, TitlecaseLetter
, ModifierLetter
, OtherLetter
, or DecimalDigitNumber
.
Zobacz też
Dotyczy
IsLetterOrDigit(String, Int32)
Wskazuje, czy znak w określonym położeniu w określonym ciągu jest kategoryzowany jako litera, czy cyfra dziesiętna.Indicates whether the character at the specified position in a specified string is categorized as a letter or a decimal digit.
public:
static bool IsLetterOrDigit(System::String ^ s, int index);
public static bool IsLetterOrDigit (string s, int index);
static member IsLetterOrDigit : string * int -> bool
Public Shared Function IsLetterOrDigit (s As String, index As Integer) As Boolean
Parametry
- s
- String
Ciąg.A string.
- index
- Int32
Pozycja znaku, który ma zostać obliczony s
.The position of the character to evaluate in s
.
Zwraca
true
Jeśli znak na pozycji index
w s
jest literą lub cyfrą dziesiętną, w przeciwnym razie false
.true
if the character at position index
in s
is a letter or a decimal digit; otherwise, false
.
Wyjątki
s
to null
.s
is null
.
index
jest mniejsza od zera lub większa od ostatniej pozycji w s
.index
is less than zero or greater than the last position in s
.
Uwagi
Pozycje znaku w ciągu są indeksowane począwszy od zera.Character positions in a string are indexed starting from zero.
Prawidłowe litery i cyfry dziesiętne są elementami członkowskimi następujących kategorii w UnicodeCategory : UppercaseLetter
,,,, LowercaseLetter
TitlecaseLetter
ModifierLetter
OtherLetter
lub DecimalDigitNumber
.Valid letters and decimal digits are members of the following categories in UnicodeCategory: UppercaseLetter
, LowercaseLetter
, TitlecaseLetter
, ModifierLetter
, OtherLetter
, or DecimalDigitNumber
.