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;

相关阅读 >>

Delphi inttostransi

Delphi 获取cpu占用时间

Delphi 使用fastscript调试脚本

Delphi 如何获取窗口的图标

Delphi 时间控制窗口标题栏文字或任务栏标题文字滚动

Delphi dbnavigator控件的按钮显示成中文

检查是否在Delphi xe7中启用或禁用了android蓝牙

Delphi 实现php的urlencode编码效果

Delphi获取文件大小

Delphi程序带参数运行

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...