| Description |
Returns true if the Unicode character, or the character at Index position in CharString is a control character.
Examples of control characters :
| 9 | Tab |
| 10 | Line feed |
| 13 | Carriage return |
|
| | 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
|
|
|
| An example of both syntaxes |
program Project1;
{$APPTYPE CONSOLE}
var
myChar : Char;
myStr : String;
begin
myChar := Chr(13); // Carriage return
if System.Char.IsControl(myChar)
then Console.WriteLine('Chr(13) is a control character')
else Console.WriteLine('Chr(13) is not a control character');
myStr := '1234';
if System.Char.IsControl(myStr, 2) // Note 0 based index
then Console.WriteLine(myStr[3] + ' is a control character') // 1 based
else Console.WriteLine(myStr[3] + ' is not a control character');
Console.ReadLine;
end.
| | Show full unit code | Chr(13) is a control character
3 is not a control character
|
| |
|
|
|