ObjectPascal
StrScan
Function
Searches for a specific character in a constant string SysUtils unit
 function StrScan ( const Characters : PAnsiChar; SearchChar : Char ) : PAnsiChar;
Description
StrScan is used when you need to check a single character against a list of known characters (Characters).
 
If the SearchChar exists in Characters, then a pointer to the position in Characters is returned.
 
If it does not exist, a nil pointer is returned.
Related commands
AnsiPos Find the position of one string in another
AnsiIndexStr Compares a string with a list of strings - returns match index
AnsiMatchStr Returns true if a string exactly matches one of a list of strings
LastDelimiter Find the last position of selected characters in a string
 
Example code : A simple example
const
  Numbers = '0123456789';
begin
  if StrScan(Numbers, '2') <> nil
  then WriteLn('2 is a numeric digit')
  else WriteLn('2 is not a numeric digit');

  if StrScan(Numbers, 'A') <> nil
  then WriteLn('A is a numeric digit')
  else WriteLn('A is not a numeric digit');
end;
Show full unit code
   2 is a numeric digit
   A is not a numeric digit