Is to directly convert the int function or get an integer.
But if the conversion fails, you will get an exception.
trystrtoint
That is, get a Boolean value, judge whether the conversion is successful according to the Boolean value, and then judge whether to fetch data.
defined variable
S: string;
I: integer;
s:= ' 1 1 1 1A ';
If it is not trystroint (s, i), then
begin
ShowMessage ('Conversion failed!' );
end
other
begin
ShowMessage ('converted successfully, the result is'++inttostr(I)););
End;