Char.IsSymbol Char.IsSymbol Char.IsSymbol Char.IsSymbol Method

定義

指示 Unicode 字元是否被分類為符號字元。Indicates whether a Unicode character is categorized as a symbol character.

多載

IsSymbol(Char) IsSymbol(Char) IsSymbol(Char) IsSymbol(Char)

指示指定的 Unicode 字元是否分類為符號字元。Indicates whether the specified Unicode character is categorized as a symbol character.

IsSymbol(String, Int32) IsSymbol(String, Int32) IsSymbol(String, Int32) IsSymbol(String, Int32)

指示指定的字串中指定位置處的字元是否分類為符號字元。Indicates whether the character at the specified position in a specified string is categorized as a symbol character.

備註

有效的UnicodeCategory符號是中下列類別目錄的成員: CurrencySymbol MathSymbolModifierSymbol、和OtherSymbolValid symbols are members of the following categories in UnicodeCategory: MathSymbol, CurrencySymbol, ModifierSymbol, and OtherSymbol.

Unicode 標準中的符號是一組鬆散定義的字元,包括下列各項:Symbols in the Unicode standard are a loosely defined set of characters that include the following:

  • 貨幣符號。Currency symbols.

  • 字母符號,其中包括一組數學英數位元符號,以及 c/o、No 和™等符號。Letterlike symbols, which include a set of mathematical alphanumeric symbols as well as symbols such as ℅, №, and ™.

  • 數位形式,例如注標和上標。Number forms, such as subscripts and superscripts.

  • 數學運算子和箭號。Mathematical operators and arrows.

  • 幾何符號。Geometric symbols.

  • 技術符號。Technical symbols.

  • 盲文模式。Braille patterns.

  • Dingbats.Dingbats.

IsSymbol(Char) IsSymbol(Char) IsSymbol(Char) IsSymbol(Char)

指示指定的 Unicode 字元是否分類為符號字元。Indicates whether the specified Unicode character is categorized as a symbol character.

public:
 static bool IsSymbol(char c);
public static bool IsSymbol (char c);
static member IsSymbol : char -> bool
Public Shared Function IsSymbol (c As Char) As Boolean

參數

c
Char Char Char Char

要評估的 Unicode 字元。The Unicode character to evaluate.

傳回

true 是符號字元時為 c,否則為 falsetrue if c is a symbol character; otherwise, false.

範例

下列程式碼範例將IsSymbol示範。The following code example demonstrates IsSymbol.

using namespace System;
int main()
{
   String^ str =  "non-symbolic characters";
   Console::WriteLine( Char::IsSymbol( '+' ) ); // Output: "True"
   Console::WriteLine( Char::IsSymbol( str, 8 ) ); // Output: "False"
}

using System;

public class IsSymbolSample {
    public static void Main() {
        string str = "non-symbolic characters"; 

        Console.WriteLine(Char.IsSymbol('+'));		// Output: "True"
        Console.WriteLine(Char.IsSymbol(str, 8));	// Output: "False"
    }
}
Module IsSymbolSample

    Sub Main()

        Dim str As String
        str = "non-symbolic characters"

        Console.WriteLine(Char.IsSymbol("+"c))      ' Output: "True"
        Console.WriteLine(Char.IsSymbol(str, 8))    ' Output: "False"

    End Sub

End Module

備註

有效的UnicodeCategory符號是中下列類別目錄的成員: CurrencySymbol MathSymbolModifierSymbol、和OtherSymbolValid symbols are members of the following categories in UnicodeCategory: MathSymbol, CurrencySymbol, ModifierSymbol, and OtherSymbol.

Unicode 標準中的符號是一組鬆散定義的字元,包括下列各項:Symbols in the Unicode standard are a loosely defined set of characters that include the following:

  • 貨幣符號。Currency symbols.

  • 字母符號,其中包括一組數學英數位元符號,以及 c/o、No 和™等符號。Letterlike symbols, which include a set of mathematical alphanumeric symbols as well as symbols such as ℅, №, and ™.

  • 數位形式,例如注標和上標。Number forms, such as subscripts and superscripts.

  • 數學運算子和箭號。Mathematical operators and arrows.

  • 幾何符號。Geometric symbols.

  • 技術符號。Technical symbols.

  • 盲文模式。Braille patterns.

  • Dingbats.Dingbats.

另請參閱

IsSymbol(String, Int32) IsSymbol(String, Int32) IsSymbol(String, Int32) IsSymbol(String, Int32)

指示指定的字串中指定位置處的字元是否分類為符號字元。Indicates whether the character at the specified position in a specified string is categorized as a symbol character.

public:
 static bool IsSymbol(System::String ^ s, int index);
public static bool IsSymbol (string s, int index);
static member IsSymbol : string * int -> bool
Public Shared Function IsSymbol (s As String, index As Integer) As Boolean

參數

s
String String String String

字串。A string.

index
Int32 Int32 Int32 Int32

要評估的字元在 s 中的位置。The position of the character to evaluate in s.

傳回

true 中位於 index 的字元是符號字元時為 s,否則為 falsetrue if the character at position index in s is a symbol character; otherwise, false.

例外狀況

index 小於零或大於 s 中的最後一個位置。index is less than zero or greater than the last position in s.

範例

下列程式碼範例將IsSymbol示範。The following code example demonstrates IsSymbol.

using namespace System;
int main()
{
   String^ str =  "non-symbolic characters";
   Console::WriteLine( Char::IsSymbol( '+' ) ); // Output: "True"
   Console::WriteLine( Char::IsSymbol( str, 8 ) ); // Output: "False"
}

using System;

public class IsSymbolSample {
    public static void Main() {
        string str = "non-symbolic characters"; 

        Console.WriteLine(Char.IsSymbol('+'));		// Output: "True"
        Console.WriteLine(Char.IsSymbol(str, 8));	// Output: "False"
    }
}
Module IsSymbolSample

    Sub Main()

        Dim str As String
        str = "non-symbolic characters"

        Console.WriteLine(Char.IsSymbol("+"c))      ' Output: "True"
        Console.WriteLine(Char.IsSymbol(str, 8))    ' Output: "False"

    End Sub

End Module

備註

字串中的字元位置會從零開始編制索引。Character positions in a string are indexed starting from zero.

有效的System.Globalization.UnicodeCategory符號是中下列類別目錄的成員: CurrencySymbol MathSymbolModifierSymbol、和OtherSymbolValid symbols are members of the following categories in System.Globalization.UnicodeCategory: MathSymbol, CurrencySymbol, ModifierSymbol, and OtherSymbol.

Unicode 標準中的符號是一組鬆散定義的字元,包括下列各項:Symbols in the Unicode standard are a loosely defined set of characters that include the following:

  • 貨幣符號。Currency symbols.

  • 字母符號,其中包括一組數學英數位元符號,以及 c/o、No 和™等符號。Letterlike symbols, which include a set of mathematical alphanumeric symbols as well as symbols such as ℅, №, and ™.

  • 數位形式,例如注標和上標。Number forms, such as subscripts and superscripts.

  • 數學運算子和箭號。Mathematical operators and arrows.

  • 幾何符號。Geometric symbols.

  • 技術符號。Technical symbols.

  • 盲文模式。Braille patterns.

  • Dingbats.Dingbats.

另請參閱

適用於