Ignore:
Timestamp:
Mar 24, 2024, 3:50:23 PM (6 weeks ago)
Author:
chronos
Message:
  • Modified: Updated Common package.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/Common.pas

    r143 r145  
    6565function GetFileFilterItemExt(Filter: string; Index: Integer): string;
    6666function IntToBin(Data: Int64; Count: Byte): string;
    67 function Implode(Separator: Char; List: TList<string>): string;
     67function Implode(Separator: string; List: TList<string>): string;
     68function Implode(Separator: string; List: TStringList; Around: string = ''): string;
    6869function LastPos(const SubStr: String; const S: String): Integer;
    6970function LoadFileToStr(const FileName: TFileName): AnsiString;
     
    206207end;*)
    207208
     209function Implode(Separator: string; List: TStringList; Around: string = ''): string;
     210var
     211  I: Integer;
     212begin
     213  Result := '';
     214  for I := 0 to List.Count - 1 do begin
     215    Result := Result + Around + List[I] + Around;
     216    if I < List.Count - 1 then Result := Result + Separator;
     217  end;
     218end;
     219
    208220function LastPos(const SubStr: String; const S: String): Integer;
    209221begin
     
    314326end;
    315327
    316 function Implode(Separator: Char; List: TList<string>): string;
     328function Implode(Separator: string; List: TList<string>): string;
    317329var
    318330  I: Integer;
Note: See TracChangeset for help on using the changeset viewer.