首页 > 其他 > 详细

boost 字符串大小写转换

时间:2016-06-16 17:46:45      阅读:139      评论:0      收藏:0      [点我收藏+]

示例代码如下:

 1 #include <boost/algorithm/algorithm.hpp>
 2 #include <iostream>  
 3 using namespace std;
 4 #include <string>
 5 
 6 void TimerTest()
 7 {
 8     // 字符串大小写转换;
 9     string strTemp = "asdQWEghhh";
10     string strTemp1 = strTemp;
11     string strTemp2 = strTemp;
12     string strTemp3 = strTemp;
13     boost::to_upper(strTemp);
14     boost::to_lower(strTemp1);
15     string strTemp4 = boost::to_upper_copy(strTemp2); // 返回值变成大写,参数不变;
16     string strTemp5 = boost::to_lower_copy(strTemp3); // 返回值变成小写,参数不变;
17 }

 

boost 字符串大小写转换

原文:http://www.cnblogs.com/qingtian224/p/5591462.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!