Home  |  Delphi .net Home  |  System.Char  |  IsLetter Method
  
IsLetter  
Method  
Returns true if a given character is a letter
Char Structure
System NameSpace
CF1.  Function IsLetter ( UnicodeChar : Char ) : Boolean; Static;
NotCF2.  Function IsLetter ( CharString : String; Index : Integer ) : Boolean; Static;
CF : Methods with this mark are Compact Framework Compatible
Description
Returns true if the Unicode character, or the character at Index position in CharString is a letter.
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
 Author links

 Buy Website Traffic at
 Buywebsitetrafficexperts.com

 Buy Proxies at
 Buyproxies.io
 
 
 
An example of both syntaxes
program Project1;
{$APPTYPE CONSOLE}

var
  myStr : String;
  i     : Integer;

begin
  if System.Char.IsLetter('a')
  then Console.WriteLine('a is a letter')
  else Console.WriteLine('a is not a letter');

  myStr := '[AaBb12]';

  for i := 0 to Length(myStr)-1 do  // Note : 0 based
    if System.Char.IsLetter(myStr, i)
    then Console.WriteLine(myStr[i+1] + ' is a letter')
    else Console.WriteLine(myStr[i+1] + ' is not a letter');

  Console.ReadLine;
end.
   a is a letter
   [ is not a letter
   A is a letter
   a is a letter
   B is a letter
   b is a letter
   1 is not a letter
   2 is not a letter
   ] is not a letter
 
 
Delphi Programming Neil Moffatt 2002 - 2017. All rights reserved.  |  Contact the author