Page 1 of 1

Force Conversion of String to Integer

Posted: 08 Oct 2020, 21:43
by Pscyking
What is the preferred method to explicitly convert a string to an integer? I have a large predefined Map<int → string> called Lookup. I receive an Input string which contains a valid integer, but it sometimes includes leading zeroes. E.g. AHK looks for Lookup["01"] instead of Lookup[1]. I am currently using Lookup[Round(Input)], but I'm wondering if there is a more elegant solution.

Re: Force Conversion of String to Integer  Topic is solved

Posted: 09 Oct 2020, 02:48
by swagfag
that would be Integer(). either call it urself or override the map's __Item property to call it, so the client code wouldnt have to