سؤال

I am doing the following conversion from string to int,

Convert.ToInt32("10D6DE", 16) -> works fine

but,

Convert.ToInt32("D0437X", 16) -> throws an format exception,
 "Additional non parsable characters at the end of string"

I am not sure whats wrong.

هل كانت مفيدة؟

المحلول

hexdigits: A sequence of hexadecimal digits from 0 through f, or 0 through F.

It won't parse your X at the end.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top