Last Updated : 11 Jul, 2025
In C#,
Char.IsSymbol()is a
System.Charstruct method which is used to check whether a Unicode character is a valid symbol defined under
UnicodeCategoryas
MathSymbol,
CurrencySymbol,
ModifierSymbol, or
OtherSymbolor not. This method can be overloaded by passing different types and number of arguments to it.
This method is used to check whether a specified Unicode character matches with any valid symbol in UnicodeCategory or not. If it matches then it returns True otherwise return False.
Syntax:public static bool IsSymbol(char ch);Parameter:
ch: It is required unicode character of System.char type which is to be checked for a valid symbol.Return Type:
The method returns True if the specified Unicode character is a valid symbol, otherwise returns False. The return type of this method is
System.Boolean. Example: CSHARP
// C# program to illustrate the
// Char.IsSymbol(Char) Method
using System;
class GFG {
// Main Method
static public void Main()
{
// Declaration of data type
bool result;
// checking if plus sign
// is symbol or not
char ch1 = '+';
result = Char.IsSymbol(ch1);
Console.WriteLine(result);
// checking if dollar sign
// is symbol or not
char ch2 = '$';
result = Char.IsSymbol(ch2);
Console.WriteLine(result);
// checking if @
// is symbol or not
char ch3 = '@';
result = Char.IsSymbol(ch3);
Console.WriteLine(result);
}
}
Char.IsSymbol(String, Int32) Method
This method is used to check whether a character in the specified string at the specified position is a valid symbol or not. If it is a symbol according to the Unicode standard then it returns True otherwise returns False.
Syntax:public static bool IsSymbol(string str, int index);Parameters:
Str: It is the required string of System.Stringtype whose character is to be checked. index: It is the position of character in specified string. Type of this parameter is System.Int32.Return Type:
The method returns True if the character at specified index in the specified string is a valid symbol according to the Unicode standard, otherwise returns False. The return type of this method is
System.Boolean.
Example: CSHARP
// C# program to illustrate the
// Char.IsSymbol(String, Int32) Method
using System;
class GFG {
// Main Method
static public void Main()
{
// Declaration of data type
bool result;
// checking for symbol in
// a string
string str1 = "www.GeeksforGeeks.org";
result = Char.IsSymbol(str1, 3);
Console.WriteLine(result);
// checking for symbol in
// a string
string str2 = "geeks+";
result = Char.IsSymbol(str2, 5);
Console.WriteLine(result);
}
}
Reference: https://learn.microsoft.com/en-us/dotnet/api/system.char.issymbol?view=netframework-4.7.2
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4