Delphi 验证TStrings是否存在

2022-12-27 09:23:41 作者:admin

本文整理自网络,侵删。

 function IsPresentInList(strings: TStrings; const value: string): Boolean;var i: Integer;begin Result := False; for i := 0 to strings.Count - 1 do if SameText(strings[i], value) then Exit(True);end;

procedure TForm1.Button1Click(Sender: TObject);beginif IsPresentInList(Memo1.Lines,LabeledEdit1.Text) thenbegin  ShowMessage('存在');  end  else  begin  ShowMessage('不存在');end;end;

相关阅读 >>

Delphi xe taskbar按钮用法

Delphi xe 遍历指定数据库,清空各表记录

Delphi 如何在webservice中获取客户端的ip地址

Delphi xe4 for ios 谨慎处理字符串

Delphi 设置本地系统时间

Delphi线程池

strpcopy 将字符串复制到字符数组中

Delphi isleapyear、isinleapyear - 是否是闰年

Delphi firedac mysql 连接

Delphi xe5 android 程序退出功能

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



在线咨询 拨打电话