FormatXreturns the hexadecimal representation of yours value.
for example String.Format("{0:X}", 10)will return "A", not"10"
X2will add zeros to the left if your hexadecimal representation is less than two characters
for example String.Format("{0:X2}", 10)will return "0A", not"A"
0,2will add spaces to the left if the resulting number of characters is less than 2.
for example String.Format("{0,3:X2}", 10)will return " 0A", but not"0A"
, {0,2:X2} , , , , . , , ,2 , {0:X2} .
:
: , . ,
String.Format("{0:X} {1:N} {0:N}", 10, 20)
, 10 ( 0) , 20 ( 1) , 10 ( 0) .
0,2 0 ,2, , . ,
String.Format("{0,1} {1,2} {0,4}", 10, 20)
, , , , , , . - .