unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
uses Generics.Collections;
procedure TForm1.Button1Click(Sender: TObject);
var
List: TList<string>;
b: Boolean;
begin
List := TList<string>.Create();
List.AddRange(['AA', 'BB', 'CC']);
ShowMessageFmt('%s : %s', [List[1], List.Items[1]]); {BB : BB}
b := List.Contains('BB');
ShowMessage(BoolToStr(b, True)); {True}
b := List.Contains('DD');
ShowMessage(BoolToStr(b, True)); {False}
List.Free;
end;
end.
详测 Generics Collections TList (7): Items、Contains
原创JLee79 ©著作权
文章标签 Generics Collections 泛型 编程开发 文章分类 后端开发
-
详讲openGauss 5.0 单点企业版如何部署_Centos7_x86
openGauss支持单机部署和单机HA部署两种部署方式。
python 数据库 openGauss Centos