Char.IsSymbol Method (String, Int32)
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Indicates whether the character at the specified position in a specified string is categorized as a symbol character.
Assembly: mscorlib (in mscorlib.dll)
'Declaration Public Shared Function IsSymbol ( _ s As String, _ index As Integer _ ) As Boolean
Return Value
Type: System.Booleantrue if the character at position index in s is a symbol character; otherwise, false.
| Exception | Condition |
|---|---|
| ArgumentNullException | s is Nothing. |
| ArgumentOutOfRangeException | index is less than zero or greater than the last position in s. |
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 such symbols as ℅, №, and ™.
Number forms, such as subscripts and superscripts.
Mathematical operators and arrows.
Geometric symbols.
Technical symbols.
Braille patterns.
Dingbats.
The following example demonstrates IsSymbol.
Module Example Public Sub Demo(ByVal outputBlock As System.Windows.Controls.TextBlock) Dim str As String str = "non-symbolic characters" outputBlock.Text &= Char.IsSymbol("+"c) & vbCrLf ' Output: "True" outputBlock.Text += String.Format(Char.IsSymbol(str, 8)) & vbCrLf ' Output: "False" End Sub End Module