I need to get a code where it should be of 7 numbers, if it is less than 7 then it should insert 0 at the start:
eg:
if(i=7)
1000001
i>7
A1234 --> 00A1234
How can i get output..?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Shweta LodhaPosted Feb 17, 2014, 3:51 PM
VulpesPosted Feb 17, 2014, 6:31 AM
Alternatively, if you're starting with hex numbers and want to convert them to hex strings which are 7 characters long, you can use the ToString() method with the "X7" format specifier:
Lakshmanan Sethu SankaranarayanPosted Feb 17, 2014, 4:20 AM