Helper of Delphi

Jan 7, 2017 13:47 · 51 words · 1 minute read

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#的扩展方法一毛一样, 写完放那就可以不用管了