ValueMatch Function
Retrieves True if the specified Value is in a String containing several values separated by given Separator which defaults to a semicolon.

Unit
QESBPCSConvert

Declaration
Function ValueMatch(const ValuesStr, Value: string; const Separator: Char = ';'): Boolean;

Description
Thus 'Mon;Tue;Wed' has 'Mon' as the 1st string, 'Tue' as the 2nd string, etc. Values are compared without case sensitivity.

Parameters
ValuesStr String containing Values separated by given Separator.
Separator Character used to separate values, defaults to ';'.

Category
Extra String Handling Routines

Implementation

function ValueMatch (const ValuesStr, Value: string;
     const Separator: Char = ';'): Boolean;
var
     P: Integer;
begin
     Result := False;
     P := 1;
     while P <= Length (ValuesStr) do
     begin
          if AnsiCompareText (ExtractValue (ValuesStr, P, Separator), Value) = 0 then
          begin
               Result := True;
               Break;
          end;
     end;
End;


HTML generated by Time2HELP
http://www.time2help.com