var
s,t: string;
i: integer;
begin
s := '123 456 7 8 9';
t := '';
for i:=1 to length(s) do
if s[i] in ['0'..'9'] then
begin
t := t + s[i]
end
else if t <> '' then
begin
// add t to array here
t := '';
end;
if t <> '' then
begin
// add last t to array here
end;
end;