【发布时间】:2014-05-03 06:04:10
【问题描述】:
我正在做以下从字符串到整数的转换,
Convert.ToInt32("10D6DE", 16) -> works fine
but,
Convert.ToInt32("D0437X", 16) -> throws an format exception,
"Additional non parsable characters at the end of string"
我不确定出了什么问题。
【问题讨论】:
-
“我不确定怎么了。”好吧 Convert.To* 尝试转换整个值,仅此而已。如果您只想转换部分值,则需要计算要转换的部分,然后转换该子字符串。
标签: c# string type-conversion formatexception