Filtra todos os números de uma string

Filtra todos os números de uma string em Delphi

Function SoNumero(Texto : String) : String;
var
Ind : Integer;
TmpRet : String;
begin
TmpRet := ”;
for Ind := 1 to Length(Texto) do
begin
if IsDigit(Copy(Texto,Ind,1)) then
begin
TmpRet := TmpRet + Copy(Texto, Ind, 1);
end;
end;
Result := TmpRet;
end;

Posts Similares