unit
Unit11;
interface
uses
Winapi
.
Windows, Winapi
.
Messages, System
.
SysUtils, System
.
Variants,
System
.
Classes, Vcl
.
Graphics, Vcl
.
Controls, Vcl
.
Forms, Vcl
.
Dialogs,
Vcl
.
StdCtrls;
type
TForm11 =
class
(TForm)
Button1: TButton;
procedure
Button1Click(Sender: TObject);
private
public
end
;
var
Form11: TForm11;
implementation
{$R *.dfm}
procedure
TForm11
.
Button1Click(Sender: TObject);
var
StringList1, StringList2: TStrings;
begin
StringList1 := TStringList
.
Create;
StringList2 := TStringList
.
Create;
try
StringList1
.
Add(
'大白补丁'
);
StringList1
.
Add(
'沙盘'
);
StringList1
.
Add(
'快速搜索'
);
StringList2
.
Add(
'大白补丁A'
);
StringList2
.
Add(
'沙盘'
);
StringList2
.
Add(
'快速搜索BBB'
);
if
StringList1
.
Equals(StringList2)
then
==============》把这里改成后者列表 是否包含 前者列表之一
ShowMessage(
'两个 TStringList 相等'
)
else
ShowMessage(
'两个 TStringList 不相等'
);
finally
StringList1
.
Free;
StringList2
.
Free;
end
;
end
;
end
.