c#字符串转数字的函数|c#字符串转数字的无错函数|c#字符串转数字的最好函数 
//字符串转整数

public int GetInt(string str)  {

  int tempInt = 0;
  int.TryParse(str,out tempInt);
  return tempInt;

  }

/字符串转整数浮点

  public decimal GetDecimal(string str)
  {
  decimal tempDecimal = 0;
  decimal.TryParse(str, out tempDecimal);
  return tempDecimal;

  }

/字符串转小树整数

  public double GetDouble(string str)
  {
  double tempDouble = 0;
  double.TryParse(str, out tempDouble);
  return tempDouble;
  }


posted on 2009-02-26 10:17 sanmao 阅读(441) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航:
 

常用链接

留言簿(5)

随笔分类

随笔档案

搜索

  •  

最新评论

阅读排行榜

评论排行榜