using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
/**
* 字符串转化为整型1
*/
static void Main(string[] args)
{
try
{
string str = "1d3";
int strInt = Convert.ToInt32(str);
Console.WriteLine(strInt);
}
catch(Exception e)
{
Console.WriteLine(e.Message + "\n" + e.StackTrace);
}
Console.ReadKey();
}
}
}
字符串转化为整型1
最新推荐文章于 2021-06-23 09:51:31 发布