In C#,
Char.IsSymbol() is a
System.Char struct method which is used to check whether a Unicode character is a valid symbol defined under
UnicodeCategory as
MathSymbol,
CurrencySymbol,
ModifierSymbol, or
OtherSymbol or not. This method can be overloaded by passing different types and number of arguments to it.
- Char.IsSymbol(Char) Method
- Char.IsSymbol(String, Int32) Method
Char.IsSymbol(Char) Method
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:
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: