string.Format
C#
2
Posts
2
Posters
0
Views
1
Watching
-
How to implement following C code in c#? sprintf( strBuf, "0x%02x", 1 ); // then the strBuf will be "0x01" rather than "0x1" in C# how can I specify string.Format( "0x{0}", 1 ) to generate 0x01, rather than 0x1? thanks :confused:
string.Format( "0x{0:X2}", 1 );
Roger Stewart "I Owe, I Owe, it's off to work I go..."