1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
TStringListHelper = class Helper for TStringList
  function Contains(value:string):Boolean;
end;


function TStringListHelper.Contains(value: string): Boolean;
var
  index: Integer;
begin
  if self.Find(str, index) then
    Exit(True)
  else
    Exit(False);
end;

简直和C#的扩展方法一毛一样, 写完放那就可以不用管了