i am trying to get string from url and convert it to integer
i am doing something like this
var
stringtoget : string;
stringint : integer;
stringtoget := IdHTTP1.Get('http://url/text.txt');
stringint := strToint(stringtoget );
But i get the following exception
Project Project1.exe raised exception class EConvertError with message ''26655 ' is not a valid integer value'.
any idea what is the problem ?
There's a trailing space on the string. That can be seen in the error message. Remove it with
Trim
before converting.