[IronPython] System.Convert Problem
Keith J. Farmer
kfarmer at thuban.org
Fri Mar 10 23:49:23 CET 2006
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: users-bounces at lists.ironpython.com 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 3720 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20060310/98eb7ff8/attachment.bin>
More information about the Ironpython-users
mailing list