program RemoveSpaces;varstr, newStr: string;i: integer;beginwrite('Enter a string: ');readln(str);
i := 1;while i <= length(str) dobeginif str[i] <> ' ' thennewStr := newStr + str[i];i := i + 1;end;
writeln('String without spaces: ', newStr);end.
program RemoveSpaces;
var
str, newStr: string;
i: integer;
begin
write('Enter a string: ');
readln(str);
i := 1;
while i <= length(str) do
begin
if str[i] <> ' ' then
newStr := newStr + str[i];
i := i + 1;
end;
writeln('String without spaces: ', newStr);
end.