String st=new String();
st=st.valueOf(MyIntVar+1);
if (MyIntVarr+1<=9)
st="0"+st;
Thanks a lot !
To convert a number to a string, you can just call the ToString method
on the number in most cases, like so:
// Assign the number.
int pintNumber = 10;
// Get the string representation.
string pstrNumber = pintNumber.ToString();
Hope this helps.
--
- Nicholas Paldino [.NET MVP]
- nicholas...@exisconsulting.com
"pm" <p...@nst.fr> wrote in message news:OzwX8C6FCHA.2772@tkmsftngp13...
string st = "";
int MyIntVar = 8;
//you can convert an int to a string and ensure that your string will show a
leading 0 with this one line of code
st = MyIntVar.ToString("00");
--
Greg
http://www.claritycon.com/
"pm" <p...@nst.fr> wrote in message news:OzwX8C6FCHA.2772@tkmsftngp13...
"pm" <p...@nst.fr> a écrit dans le message de news:
OzwX8C6FCHA.2772@tkmsftngp13...
String st = ( MyIntVar+1 ).ToString("00");
Chris R.
"pm" <p...@nst.fr> wrote in message news:OzwX8C6FCHA.2772@tkmsftngp13...
int myvar = 1;
myvar += 1;
string st = myvar.ToString();
if((myvar + 1) <= 9)
st = "0" + myvar.ToString();