返回顶部

收藏

C++ 字符串转换

更多
bool b      = "true".ConvertTo<bool>();
DateTime d1 = " 01:23:45 ".ConvertTo<DateTime>();
Point p     = "100,25".ConvertTo<Point>();

//convert, but use specific culture. 
//in this case the comma is used as a decimal seperator
Double d    = "1.234,567".ConvertTo<double>("NL")

//provide a default value, if conversion fails
Guid g      = "i'm not a guid".ConvertTo<Guid>(Guid.Empty);

标签:c++

收藏

0人收藏

支持

0

反对

0

»更多 您可能感兴趣的代码
  1. 2017-07-23 12:42:20奇数魔方阵 by Kevin.
  2. 2017-07-18 14:15:24两种方法计算“算术表达式” by aiheng1988
  3. 2015-09-09 16:29:06将jpg转换为bmp格式的文件 by qqmmcc
  4. 2015-09-09 09:29:49可执行文件加密 by walker30
  5. 2015-09-08 18:42:46TCP端口占用查询 by 灵剑子
  6. 2015-09-08 14:16:34Luffar schack五子棋 by 蟋蟀哥
  7. 2015-09-08 10:39:34wav转mp3的程序 by 灵剑子
  8. 2015-09-05 16:54:59逐行搜索目录中的文件内容并输出到Excel by 蟋蟀哥
  9. 2015-09-03 20:10:15LZW+AES+Base64编码解码剪贴板文本 by 童学芬
  10. 2015-09-01 17:47:21猫里奥 by aiheng1988
  11. 2015-08-31 15:33:59模拟键盘操作发送字符串 by 千万不要郁闷

发表评论