String Format Question

  • Thread starter Thread starter Bishman
  • Start date Start date
B

Bishman

Hi,

A quick one for someone hopefully.....

How do I return a string "003" from the integer 3 ?

I believe its something like:

int tempval = 3;
string tempstr = String.Format("{0???}",tempval);

??? = Thats where I am stuck !

I dont find the Help particuarly helpfull on this one

Any ideas please,

Thanks in advance

Jon
 
Bishman said:
Hi,

A quick one for someone hopefully.....

How do I return a string "003" from the integer 3 ?

I believe its something like:

int tempval = 3;
string tempstr = String.Format("{0???}",tempval);

??? = Thats where I am stuck !

I dont find the Help particuarly helpfull on this one

Any ideas please,

Thanks in advance

Jon

string tempstr = tempval.ToString ("000");

Hope that helps,

Nick
http://seecharp.blogspot.com/
 
Back
Top