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 of AnsiChar.

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.

Note: We recommend to use the TCharacterHelper record helper (which is Unicode enabled) whenever possible to check whether a character enters a certain category, such as digits or letters.
Note: If you want to match any UNICODE characters, you can use the IsInArray method.

See Also