asp.net 整型1234转换字符串'1234'
整型1234转换字符串 '1234 ';不能使用系统的函数,可以使用类型.
------解决方案--------------------string number = "0123456789 ";
string s = " ";
for (int i = 1234; i > 0; i /= 10)
s = number[i % 10] + s;
Text = s;
------解决方案--------------------修正代码:
static string ConvertToString(int num)
{
string ret = " ";
while (num > 0)
{
ret = (num % 10) + ret;
num /= 10;
}
return ret;
}