Wednesday, April 28, 2010

padding zero

Sometime when you need to append padding zero for a numeric figure. e.g. 0001, 0002 .

You might think to write your own 'sweet' logic to format the string. The good news is, .net out of the box gives you this feature.

string.Format("{0:00000}", yourIntegerValue);

No comments:

Post a Comment