boost 字符串大小寫轉換


示例代碼如下:

 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 }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM