Hello. Just a quickie
Is there a function that removes all spaces from a given string.
So say i have the words (''Hello To All'')
Can i use a function so that the string becomes (''HelloToAll'')
Any help would be appreciated. Thanks in advance
Is there a function to delete spaces from a string?
Started by standard, Apr 21 2010 03:21 PM
3 replies to this topic
#1
Posted 21 April 2010 - 03:21 PM
|
|
|
#2
Posted 21 April 2010 - 04:24 PM
#3
Posted 23 April 2010 - 10:46 AM
nice one adam :)
#4
Posted 22 May 2010 - 10:49 PM
Quote
So say i have the words (''Hello To All'')
Can i use a function so that the string becomes (''HelloToAll'')
Can i use a function so that the string becomes (''HelloToAll'')
function MyTrim(txt : String) : String;
var
tmp : String;
n : Integer;
begin
tmp :='';
for n:=1 to StrLen(PChar(txt)) do
begin
if RightStr(LeftStr(txt,n),1) <> ' ' then
tmp := tmp + RightStr(LeftStr(txt,n),1);
end;
Result := tmp;
end;
For Use :
procedure TForm1.Button1Click(Sender: TObject); begin Edit1.Text := MyTrim(Edit1.Text); end;
Good Luck


Sign In
Create Account

Back to top









