function ValidateChars(const Value, ValidChars: string): boolean;
begin
for var v in Value do
begin
var Valid: boolean := False;
for var c in ValidChars do
if (c = v) then
begin
Valid := True;
break;
end;
if (not Valid) then
Exit(False);
end;
Result := True;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
if ValidateChars('b','12345中国人') then
begin
text:='yes';
end
else
begin
text:='no';
end;
end;
Copyright © 2014 DelphiW.com 开发 源码 文档 技巧 All Rights Reserved
晋ICP备14006235号-8 晋公网安备 14108102000087号
执行时间: 0.057360887527466 seconds