So I was in a middle of converting string to hex value represenation and By mistake instead of writing
ToString("X0")
I wrote
ToString("X100")
var t="123";
for (int i=0;i<t.Length;i++)
{
Console.WriteLine( ((int)t[i]).ToString("X100"));
}
the values were :
X149
X150
X151
p.s. :
ToString("X10") yields :
0000000031
0000000032
0000000033
ToString("X99") yields : ( same with many zeros)
but when jumping like 100 , 1000 , 10000…. it yields somwthing with X
what is this X representation ? X149 for example…?
For the
xandXformat specifiers, as with all of the standard numeric formats, you can only request up to 99 digits. Once you try to ask for more than that, you no longer have a standard format specifier, but a custom one.In a custom format specifier, ‘0’ means to include a digit in the original number, and everything else is kept as a constant.
So:
etc.
(To explain that last one: each 0 represents the next digit in the number being formatted; the first 0 was replaced by a 2, the second 0 was replaced by a 9. These get really tricky really fast.)