- 人气:
- 放大
- 缩小
- 二维码
- 赞赏
delphi 判断字符串是否包含数字
function checkstr1(const str: string): Boolean;
var
j:integer;
begin
Result :=false;
for J:=1 to Length(str) do
begin
if (str[J] in ['0'..'9']) then
begin
Result :=true;
break;
end;
end;
end;
procedure TForm16.Button1Click(Sender: TObject);
begin
if checkstr1(edit1.text) then
begin
caption:='t';
end
else
begin
caption:='f';
end;
end;