正如标题中所说,我无法找到有关如何检查字符串是否PW
包含数字的解决方案。PW
如果字符串包含数字 ,我如何检查 TP ?
repeat
writeln;
writeln('Ok, please enter your future password.');
writeln('Attention: The Text can only be decoded with the same PW');
readln(PW);
pwLength:= Length(PW);
error:=0;
for i:= 1 to Length(PW) do begin
if Input[i] in ['0'..'9'] then begin
error:=1;
end;
end;
if Length(PW)=0 then
begin
error:=1;
end;
if Length(PW)>25 then
begin
error:=1;
end;
if error=1 then
begin
writeln('ERROR: Your PW has to contain at least 1character, no numbers and has to be under 25characters long.');
readln;
clrscr;
end;
until error=0;