开发者

How convert string to integer in Oxygene

开发者 https://www.devze.com 2022-12-11 03:18 出处:网络
In Delphi, there is a function StrToInt() that converts a string t开发者_JS百科o an integer value; there is also IntToStr(), which does the reverse.These functions doesn\'t appear to be part of Oxygen

In Delphi, there is a function StrToInt() that converts a string t开发者_JS百科o 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?


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.


RRUZ has the correct answer, but if you can't say good-bye to all the functions and classes you where used to in Delphi win32 you could take a look at ShineOn. It's an open source library written in Delphi Prism to port Delphi win32 functions and classes to .Net. Not surprisingly it also contains IntToStr and StrToInt.

0

精彩评论

暂无评论...
验证码 换一张
取 消