So here is a collection of printing values as hexadecimal string.
The simpliest way is to use the IFormattable interface:
1: String.Format("{0:X02}", int.MaxValue);
Other ways with support of differend radix is to user Convert.ToString().
Radix could be 2, 8, 10, or 16.
1: Convert.ToString(int.MaxValue, 2);
From:
MSDN: Convert.ToString()
mikrocontroller.net
Are there any other ways? So let me know!
No comments:
Post a Comment