[Lazarus] Saving an array to a string

silvioprog silvioprog at gmail.com
Tue Jul 1 17:14:05 CEST 2014


2014-07-01 11:49 GMT-03:00 Richard Mace <richard.mace at gmail.com>:

> Hi All,
> Is it possible to save an array of string to a single string for storing
> in a string field within a database?
> If so, could anyone give me any pointers please?
>
> Thanks
>

You can use RUtils plugin:

https://github.com/silvioprog/rutils

So:

uses
  RUtils;

procedure TForm1.Button1Click(Sender: TObject);
var
  ar: array of string;
begin
  // your array
  SetLength(ar, 2);
  ar[0] := 'abc';
  ar[1] := 'def';
  ar[2] := 'ghi';

  // array of string to string
  ShowMessage(RUtils.Implode(ar));
end;

-- 
Silvio Clécio
My public projects - github.com/silvioprog
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20140701/b7341fdc/attachment-0003.html>


More information about the Lazarus mailing list