Stef Merlijn
asked on
Quickly scan string if it contains certain characters
Hi,
I need to check if a string contains following characters/tokens (between the single qoutes).
'*','"','/','\','<','>','? ',':','|' Ā (these are the characters/tokens that aren't allowed in filenames).
For entering individual characters in the editfield I use the function below in the OnKeyPress-event. But when a user paste a string into the editfield, this event isn't fired. Therefor I want to check the inserted string afterwards.
Can anybody supply me with a fast function that will do the trick? Or maybe a better solution is possible?
Regards, Stef
I need to check if a string contains following characters/tokens (between the single qoutes).
'*','"','/','\','<','>','?
For entering individual characters in the editfield I use the function below in the OnKeyPress-event. But when a user paste a string into the editfield, this event isn't fired. Therefor I want to check the inserted string afterwards.
Can anybody supply me with a fast function that will do the trick? Or maybe a better solution is possible?
Regards, Stef
function GeldigTekenBestandsnaam(var Key : Char) : Boolean;
begin
Result := True;
If (key in ['*','"','/','\','<','>','?',':','|']) then
Result := False;
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Perfect.
ziolko.