IntToStr / StrToInt
Try it yourself →Number ↔ text conversion.
Syntax
IntToStr(number) · StrToInt(text)
Description
IntToStr converts a number to text, StrToInt converts text to a number. Comes in the SysUtils unit (uses SysUtils).
Example
program H;
{$MODE DELPHI}
uses SysUtils;
begin
writeln(StrToInt('15') + StrToInt('27'));
end.Expected output
42
When to use?
Ignoring input text, combining a number with text.
Common mistakes
- ⚠️ uses SysUtils; is required for conversion functions.