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
热度:7 发布时间:2024-01-17 03:34:53.0
相关解决方案