您的位置:首页 > 其它

字符串转化为整型2

2012-02-23 14:53 232 查看
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
class Program
{
/**
* 字符串转化为整型2
*/
static void Main(string[] args)
{
int i;

if (int.TryParse("12", out i))
{
Console.WriteLine(i);
}
else
{
Console.WriteLine("字符串转为为整型错误.");
}

Console.ReadKey();
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: