Skip to content

Commit

Permalink
StringsHelper: +func. LastLine
Browse files Browse the repository at this point in the history
  • Loading branch information
jackdp committed Aug 21, 2020
1 parent 3c1437c commit 27f5357
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Base/JPL.TStringsHelper.pas
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ interface

type

{ TStringsHelper }

TStringsHelper = class helper for TStrings
procedure TrimAllLines;
procedure RemoveEmptyLines;
Expand All @@ -18,6 +20,8 @@ TStringsHelper = class helper for TStrings
// Warning! Use only for lists with a relatively small number of lines (up to several thousand)
// With larger lists it is very slow!
procedure RemoveDuplicatesWithoutSorting(IgnoreCase: Boolean = False);

function LastLine: string;
end;


Expand Down Expand Up @@ -124,5 +128,12 @@ procedure TStringsHelper.RemoveDuplicatesWithoutSorting(IgnoreCase: Boolean);
end;
end;

function TStringsHelper.LastLine: string;
begin
Result := '';
if Count = 0 then Exit;
Result := Strings[Count - 1];
end;


end.

0 comments on commit 27f5357

Please sign in to comment.