JCL Help:StrIsSubset@AnsiString@TSysCharSet

From Project JEDI Wiki
Jump to navigationJump to search


Summary

Tests whether S contains only characters from the supplied set.


Pascal

 function StrIsSubset(const S: string; const ValidChars: TCharValidator): Boolean; overload;
function StrIsSubset(const S: string; const ValidChars: array of Char): Boolean; overload;
function StrIsSubset(const S: AnsiString; const ValidChars: TSysCharSet): Boolean;


Parameters

Parameters Description
const S: string The string to test.
const ValidChars: TCharValidator The set of characters allowed in S.


Return Value

If the string contains only characters from the supplied set the result is True, otherwise the result is False.


Description

StrIsSubset tests whether the supplied string contains only characters from the supplied character set. Keep in mind that the test is case-sensitive.


About

Unit

JclAnsiStrings


Donator

Marcel van Brakel


Notes

If the supplied string is empty, the result is always True. If the supplied character set is empty, the result is always False. Empty string overules empty set.


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page