Changeset 560 for Common/UCommon.pas


Ignore:
Timestamp:
Sep 10, 2022, 11:35:01 AM (2 years ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
  • Added: Implode and explode method.
  • Added: Custom specialized generic classes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Common/UCommon.pas

    r558 r560  
    77  {$IFDEF UNIX}baseunix,{$ENDIF}
    88  Classes, SysUtils, StrUtils, Dialogs, Process, LCLIntf, Graphics,
    9   FileUtil; //, ShFolder, ShellAPI;
     9  FileUtil, Generics.Collections; //, ShFolder, ShellAPI;
    1010
    1111type
     
    6565function GetFileFilterItemExt(Filter: string; Index: Integer): string;
    6666function IntToBin(Data: Int64; Count: Byte): string;
     67function Implode(Separator: Char; List: TList<string>): string;
    6768function LastPos(const SubStr: String; const S: String): Integer;
    6869function LoadFileToStr(const FileName: TFileName): AnsiString;
     
    313314end;
    314315
     316function Implode(Separator: Char; List: TList<string>): string;
     317var
     318  I: Integer;
     319begin
     320  Result := '';
     321  for I := 0 to List.Count - 1 do begin
     322    Result := Result + List[I];
     323    if I < List.Count - 1 then Result := Result + Separator;
     324  end;
     325end;
     326
    315327{$IFDEF WINDOWS}
    316328function GetUserName: string;
Note: See TracChangeset for help on using the changeset viewer.