I know what the ToString() method does, but what is the "x2" argument all about?
I've seen this in a code sample where they were converting from a byte to a string and I assume that the "x2" is just a format for the string, but not sure exactly what it is or what it does?
BurritoSmith
Member
15 Points
69 Posts
what is ToString("x2")?
Feb 19, 2007 05:54 PM|LINK
I know what the ToString() method does, but what is the "x2" argument all about?
I've seen this in a code sample where they were converting from a byte to a string and I assume that the "x2" is just a format for the string, but not sure exactly what it is or what it does?
please advise,
Thanks,
Burr
vivek_iit
All-Star
17778 Points
3189 Posts
MVP
Re: what is ToString("x2")?
Feb 19, 2007 06:33 PM|LINK
Hi Burr,
"X2" here is the hexadecimal format specifier. Refer to this article for details on format specifiers:
http://authors.aspalliance.com/aspxtreme/aspnet/types/numericformatstrings.aspx
Hope this helps,
Vivek
Communifire: Social Networking and Business Collaboration Platform
sanjeev_asp....
Member
89 Points
55 Posts
Re: what is ToString("x2")?
Feb 20, 2007 06:15 AM|LINK
Thanks!! [:)]
I think lot of people doesn't know about this.