Bionicle
2010-04-02 18:52:44
Is there any way to remove the spaces from a string?
2010-04-02 18:52:44
2010-04-02 18:53:25
program New;
var
s: string;
begin
s := Replace('This work?', ' ', '');
writeln(s);
end.
2010-04-02 18:53:38
2010-04-02 18:56:13
From: Timer
program New;
var
s: string;
begin
s := Replace('This work?', ' ', '');
writeln(s);
end.
Mario cookie 4 u, nom nom.
2010-04-02 18:56:50
From: bionicle1800
Thank you!
(btw u had it backwards, it would be s := Replace('This work', ' ', ''); :p)Mario cookie 4 u, nom nom.
program New;
var
s: string;
ss: TStringArray;
i, h: Integer;
begin
s := 'Lets blow this bitch up!';
ss := Explode(' ', s);
h := High(ss);
for i := 0 to h do
WriteLn(ss[i]);
end.
2010-04-02 19:22:50
2010-04-02 19:33:51
From: Nava2
Or just trim..
2010-04-02 20:16:42
From: Nava2
Or just trim..
2010-04-02 20:18:12
From: Frement
Doesnt trim remove the left and right space?
2010-04-02 20:20:00
From: Dgby714
Yes, Trim wouldn't remove spaces if there in the middle of a string =)
2010-04-02 20:45:52
2010-04-03 00:53:10
From: i luffs yeww
How is correcting a mistake being rude? He might've meant TrimOthers, which would work if the string he wanted was only alphanumerical characters.
2010-04-03 05:33:29
2010-04-03 11:10:21
{.include SRL/SRL.scar}
var
s: string;
begin
SetupSRL;
s := srl_Implode(srl_Explode('oh meow?', ' '), '');
Writeln(s);
end.
2010-04-03 11:25:11
From: i luffs yewwSilly, i luffs yeww. There's no need for SetupSRL; there!
Silly, mixster. There's only two parameters each function!
{.include SRL/SRL.scar}
var
s: string;
begin
SetupSRL;
s := srl_Implode(srl_Explode('oh meow?', ' '), '');
Writeln(s);
end.
{.include SRL/SRL.scar}
begin
Writeln(srl_Implode(srl_Explode('oh meow?', ' '), ''));
end.