I think System.Int32.TryParse is the preferred API now. It allows you to not rely on exceptions to determine that the input string won't parse.
________________________________
From: [EMAIL PROTECTED] on behalf of Ernst, Nathan
Sent: Fri 3/10/2006 1:19 PM
To: Discussion of IronPython
Subject: Re: [IronPython] System.Convert Problem
If you're trying to convert strings to ints in IronPython, the pythonic
way of doing it would be to use the built-in "int":
>>> int("A")
Traceback (most recent call last):
File "<stdin>", line 1, in ?
ValueError: invalid literal for int(): A
>>> int("A", 16)
10
<<winmail.dat>>
_______________________________________________ users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
