I tried int.parse,
and convert class to convert a string to int.
While I\'m converting. I\'m losing the 0 in the beginning which i don\'t want.
No, int.Parse("09999")
actually returns 0x0000270F. Exactly 32 bits (because that's how big int
is), 18 of which are leading zeros (to be precise, one is a sign bit, you could argue there are only 17 leading zeros).
It's only when you convert it back to a string that you get "9999", presence or absence of the leading zero in said string is controlled by the conversion back to string.