Wednesday, March 3, 2010

Left Pad and Integer in C#

From - http://www.victorchen.info/left-pad-an-integer-with-zeros-in-c/

int myNumber = 234;
string myStringNumber = myNumber.ToString().PadLeft(16, '0');

No comments: