Edit

Share via


Char.IsSymbol Method

Definition

Indicates whether a Unicode character is categorized as a symbol character.

Overloads

IsSymbol(String, Int32)

Indicates whether the character at the specified position in a specified string is categorized as a symbol character.

IsSymbol(Char)

Indicates whether the specified Unicode character is categorized as a symbol character.

Examples

The following code example demonstrates IsSymbol.

C#
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"
    }
}

Remarks

Valid symbols are members of the following categories in UnicodeCategory: MathSymbol, CurrencySymbol, ModifierSymbol, and OtherSymbol.

Symbols in the Unicode standard are a loosely defined set of characters that include the following:

  • Currency symbols.

  • 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.

IsSymbol(String, Int32)

Source:
Char.cs
Source:
Char.cs
Source:
Char.cs

Indicates whether the character at the specified position in a specified string is categorized as a symbol character.

C#
public static bool IsSymbol(string s, int index);

Parameters

s
String

A string.

index
Int32

The position of the character to evaluate in s.

Returns

true if the character at position index in s is a symbol character; otherwise, false.

Exceptions

index is less than zero or greater than the last position in s.

Remarks

Character positions in a string are indexed starting from zero.

Valid symbols are members of the following categories in System.Globalization.UnicodeCategory: MathSymbol, CurrencySymbol, ModifierSymbol, and OtherSymbol.

Symbols in the Unicode standard are a loosely defined set of characters that include the following:

  • Currency symbols.

  • 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.

See also

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0

IsSymbol(Char)

Source:
Char.cs
Source:
Char.cs
Source:
Char.cs

Indicates whether the specified Unicode character is categorized as a symbol character.

C#
public static bool IsSymbol(char c);

Parameters

c
Char

The Unicode character to evaluate.

Returns

true if c is a symbol character; otherwise, false.

Remarks

Valid symbols are members of the following categories in UnicodeCategory: MathSymbol, CurrencySymbol, ModifierSymbol, and OtherSymbol.

Symbols in the Unicode standard are a loosely defined set of characters that include the following:

  • Currency symbols.

  • 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.

See also

Applies to

.NET 9 and other versions
Product Versions
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 2.0, 2.1
UWP 10.0