Janilabo

Janilabo | TSAConcatEx() [SCAR Divi]

Apr 28th, 2013
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.68 KB | None | 0 0
  1. {==============================================================================]  
  2.   Explanation: Returns string of all TSA items binded together. Places glue between the indexes.                
  3. [==============================================================================}
  4. function TSAConcatEx(TSA: TStrArray; glue: string): string;
  5. var
  6.   h, i: Integer;
  7. begin
  8.   Result := '';
  9.   h := High(TSA);
  10.   if (h > -1) then
  11.   begin
  12.     for i := 0 to (h - 1) do
  13.       Result := (Result + string(TSA[i]) + string(glue));
  14.     Result := (Result + string(TSA[i]));
  15.   end;
  16. end;
  17.  
  18. begin
  19.   ClearDebug;
  20.   WriteLn(TSAConcatEx(['This', 'is', 'a', 'test', 'for', 'TSAConcatEx()'], ' '));
  21. end.
Advertisement
Add Comment
Please, Sign In to add comment