前言
参考自:C/C++:字符串大小写转换的几种方式
用法
应用:字符串大小写转换
参数:
1 2 3 4
   | OutputIterator transform ( InputIterator first1,                                   InputIterator last1,                                     OutputIterator result,                                   UnaryOperator op );     
   | 
 
返回值:目标容器存储字符串后的下一个位置的迭代器,具体请看下面实例第三步——测试返回值
实例:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
   | string str = "dqywy"; cout << "转换前:" << str << endl; transform(str.begin(), str.end(), str.begin(), toupper); cout << "转换后:" << str << endl;
 
  string str = "dqywy"; string temp = "dqywy99"; cout << "转换前:" << str << endl; transform(str.begin(), str.end(), temp.begin(), toupper); cout << "转换后:" << temp << endl;
 
 
 
 
  string str = "dqywy"; string temp = "dqywy99"; string::iterator p;	 cout << "转换前:" << str << endl; p = transform(str.begin(), str.end(), temp.begin(), toupper); cout << "转换后:" << temp << endl; cout << "transform返回值解引用:" << *p << endl; return 0;
   |