RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
SysUtils.CharInSet Function

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

Pascal
function CharInSet(C: AnsiChar; const CharSet: TSysCharSet): Boolean; overload;
function CharInSet(C: WideChar; const CharSet: TSysCharSet): Boolean; overload;
C++
Boolean CharInSet(AnsiChar C, const TSysCharSet CharSet);
Boolean CharInSet(WideChar C, const TSysCharSet CharSet);

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.
 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!