Código
var
quant: integer;
x_ini, x_fim: string;
Begin
quant:= Length(x);
x_ini:= copy(x,0,1);
x_fim:= copy(x,quant,1);
if (x_ini = ' ') and (x_fim = ' ') then
begin
delete(x,1,1);
delete(x,(quant-1),1);
end;
if (x_ini = ' ') and (x_fim <> ' ') then
delete(x,1,1);
if (x_ini <> ' ') and (x_fim = ' ') then
delete(x,quant,1);
Result:=x;
end;
// exemplo de funcionamento
procedure TForm1.Button1Click(Sender: TObject);
begin
edit2.text:= (tira_espaco(edit1.text));
end;
Planeta Delphi - www.planetadelphi.com.br - Todos os direitos reservados | Copyright 2001-2009