Answer the question
In order to leave comments, you need to log in
How to split a TStringlist string without a loop?
Let's say there is a string: "Hello world!" in TStringList , how to assign another TStringlist "Hello" without looping ?
Answer the question
In order to leave comments, you need to log in
What is the problem and what is the solution:
procedure someProcedure();
var
s1, s2 : TStringList;
begin
s1 := TStringList.Create;
s2 := TStringList.Create;
try
s1.LineBreak := ' ';
s1.Text := 'Hello world!';
s2.Text := s1.Strings[0];
ShowMessage(s2.Text);
finally
s1.Free;
s2.Free;
end;
end;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question