How about:
function RemoveAnythingButNumbers(aString: string): string;
var
C: Char;
begin
Result := '';
for C in aString do
begin
if C in ['0'..'9'] then Result := Result + C;
end;
end;
Note that I corrected the set of numbers.
Вопрос
Is there a function to reverse FloatToStrF
? By that I mean go back from currency money format to string format. For example:
Edit1.Text := FloatToStrF(10000, ffCurrency, 15, 4);
The result
Edit1.Text = '$10,000.0000'
I'm wondering if there is somthing like StrToFloatF
so
Edit1.Text = '10000';
thank's
Решение
How about:
function RemoveAnythingButNumbers(aString: string): string;
var
C: Char;
begin
Result := '';
for C in aString do
begin
if C in ['0'..'9'] then Result := Result + C;
end;
end;
Note that I corrected the set of numbers.