Description |
Returns true if the Unicode character, or the character at Index position in CharString is a symbol character.
Examples of symbol characters :
+-/= | Mathematical symbols |
$? | Currency symbols |
|
|
Notes |
Very Important : Methods in .Net treat strings as starting at 0, unlike traditional Delphi where they started at 1.
Static methods are not methods of an object - they are simply class functions or procedures available at any time.
|
|
Microsoft MSDN Links |
System
System.Char
System.Char.IsSymbol
|
|
|
|
An example of both syntaxes |
program Project1;
{$APPTYPE CONSOLE}
var
myChar : Char;
myStr : String;
begin
myChar := '(';
if System.Char.IsSymbol(myChar)
then Console.WriteLine(myChar + ' is a symbol character')
else Console.WriteLine(myChar + ' is not a symbol character');
myStr := '12+9=21'; if System.Char.IsSymbol(myStr, 2) // Note 0 based index then Console.WriteLine(myStr[3] + ' is a symbol character') // 1 based
else Console.WriteLine(myStr[3] + ' is not a symbol character');
Console.ReadLine;
end.
|
( is not a symbol character
+ is a symbol character
|
|