Weil schönes Wetter ist (wo auch immer)
Delphi-Quellcode:
type
TSetofChars = Set of Char;
function OnlyNumbersInString (const aValue : String; aChars : TSetofChars) : String;
var
i: Integer;
newString : string;
begin
newString := '';
for i := 0 to Length(aValue) do
begin
if aValue[i] in aChars then
begin
newString := newString + aValue[i];
end;
end;
result := newString;
end;
procedure TForm1.TestButtonClick(Sender: TObject);
begin
Edit2.Text := OnlyNumbersInString(Edit1.Text,['0'..'9']);
end;
Stephan B.
"Lasst den Gänsen ihre Füßchen"