System.SysUtils.CharInSet
Delphi
function CharInSet(C: AnsiChar; const CharSet: TSysCharSet): Boolean;
function CharInSet(C: WideChar; const CharSet: TSysCharSet): Boolean;
C++
extern DELPHI_PACKAGE bool __fastcall CharInSet(char C, const TSysCharSet &CharSet)/* overload */;
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
function | public | System.SysUtils.pas System.SysUtils.hpp |
System.SysUtils | System.SysUtils |
Description
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.