Text String Split

Hello friends, I have a text that I separate with this command

var
len :integer;
s  :string;
begin
s:= 'Have a nice day';
while s<>'' do
begin
len := pos(' ', s);
if len=0 then len := Length(s);
Memo1.Text:=h;(copy(s, 0, len));
s := copy(s, len+1, Length(s)-len);    
end;  
end;

The output is displayed in Memo1 = "day"

The problem is that only the last letter is displayed. I want to output all letters separately

How to get each sentence in Memo separately from the output?

like this :

Memo1.Text:='Have'
Memo2.Text:='a'
Memo3.Text:='nice'
Memo4.Text:='day'


Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.