How convert string to integer in Oxygene

Bill Seven picture Bill Seven · Nov 9, 2009 · Viewed 7.9k times · Source

In Delphi, there is a function StrToInt() that converts a string to an integer value; there is also IntToStr(), which does the reverse. These functions doesn't appear to be part of Oxygene, and I can't find a reference to something that can do that. How can it be done?

Answer

RRUZ picture RRUZ · Nov 9, 2009

You can use the Int32.Parse function

try this

function StrToInt(S: String): Integer;
begin
  Result:=Int32.Parse(S);
end;

.Parse is pretty richly supported for multiple types.