Hola,
Creo que este tipo de entradas son propensas a fallar, pero, en fin, no me quedo con las ganas:
Código Delphi
[-]
function DirtyIntToStr
(str: string): string;
var
pStr: PChar;
begin
pStr := PChar(str);
while (pStr^<>#0)do
begin
if (pStr^in['0'..'9']) then
Result := Result + pStr^;
Inc(pStr);
end;
end;
Y, casi por el mismo precio:
Código Delphi
[-]
function DirtyFloatToStr
(str: string): string;
var
pStr: PChar;
begin
pStr := PChar(str);
while (pStr^<>#0)do
begin
if (pStr^in['0'..'9',DecimalSeparator]) then
Result := Result + pStr^;
Inc(pStr);
end;
end;
Nota: no lo hagan en sus casas; si tienen, escogan otras alternativas.
Segunda nota: lo siento Marcos, no tiene nada que ver con tu respuesta, es que no he podido evitarlo.