From RAD Studio API Documentation
Jump to: navigation, search


function CharInSet(C: AnsiChar; const CharSet: TSysCharSet): Boolean;
function CharInSet(C: WideChar; const CharSet: TSysCharSet): Boolean;


extern DELPHI_PACKAGE bool __fastcall CharInSet(char C, const TSysCharSet &CharSet)/* overload */;


Type Visibility Source Unit Parent
function public
System.SysUtils System.SysUtils


CharInSet checks whether a given character is contained within a set.

Use CharInSet to check whether a given character is contained within a set of characters. CharInSet checks whether the C parameter is contained within the CharSet set. C can either be a Unicode or an ANSI character, while CharSet can only be a set of ANSI characters. The function returns True if the character is contained within the set and False if the character is not contained within the set or if the character is Unicode.

Note: We recommend that the TCharacter class (which is Unicode enabled) be used whenever possible to check whether a character enters a certain category, such as digits or letters.

See Also