пятница, 7 ноября 2008 г.

C# numeric format string with fixed length


Do you want to get from 'int' value 'string' representation with fixed length?
Here is solution:) Example:


int iVal = 53;
string strVal = iVal.ToString("0000");


Result:
0053


Enjoy:)