Mega Code Archive

 
Categories / Delphi / Examples
 

Does a string looks like an integer

Use this function to determine, whether a given string represents an integer. function IsInteger(TestThis: String): Boolean; begin try StrToInt(TestThis); except on EConvertError do result := False; else result := True; end; end;