SRL Archive - NOTA

function CompressTStringArray(TSA: TStringArray): String; /boredom


All that is man

2009-12-05 00:29:32

I don't think there's anything like this ;) Just really really bored…


function CompressTStringArray(TSA: TStringArray): String;
var
i: integer;

begin
result := result + TSA[0];
for i := 1 to high(TSA) do
result := result + ' ' + TSA[i];
end;

Used Like:


program New;
var
SA: TStringArray;

function CompressTStringArray(TSA: TStringArray): String;
var
i: integer;

begin
result := result + TSA[0];
for i := 1 to high(TSA) do
result := result + ' ' + TSA[i];
end;
begin
SA := [ 'lol', 'sup', 'ohai' ];
Writeln(CompressTStringArray(SA));
end.

Feedback?

Boreas

2009-12-05 01:34:52

Nice job. This one is in SRL: srl_Implode
http://www.villavu.com/repositories/srl-opendev/SRL/core/Text.scar

All that is man

2009-12-05 01:59:01

Lol thanks, and I never new about srl_Implode

Bionicle

2009-12-05 09:47:24

Just took a quick glance over the coding, this would turn a TStringArray into a single string? So ur [ 'lol', 'sup', 'ohai' ] would turn into 'lol sup ohi'?

All that is man

2009-12-05 14:51:15

From: bionicle1800
Just took a quick glance over the coding, this would turn a TStringArray into a single string? So ur [ 'lol', 'sup', 'ohai' ] would turn into 'lol sup ohi'?


Precisely