第1个回答 2013-03-12
private string intToString(int i)
{
string s = i.ToString();
while (s.Length < 2)
{
s = "0" + s;
}
return s;
}
楼主可以参考下这个,如果不足两位,那就补足。看看能否满足你要求
追问这个明显太麻烦了 还是谢谢你哈!~
本回答被网友采纳
第2个回答 2013-03-12
int i = 1;
Console.WriteLine(i.ToString("0#"));
第3个回答 2013-03-14
private string intToString(int i)
{
while (i< 10)
{
string s=i.Tostring();
s = "0" + s;
}
return s;
}
第4个回答 2013-03-12
private string intToString(int i)
{
string s = i.ToString();
while (s.Length < 2)
{
s = "0" + s;
}
return s;
}
楼主可以参考下这个,如果不足两位,那就补足。看看能否满足你要求
追问这个明显太麻烦了 还是谢谢你哈!~
本回答被网友采纳
第5个回答 2013-03-12
int i = 1;
Console.WriteLine(i.ToString("0#"));
第6个回答 2013-03-14
private string intToString(int i)
{
while (i< 10)
{
string s=i.Tostring();
s = "0" + s;
}
return s;
}