C++ 字符串大小写转换
来源:互联网 发布:勇敢的心mv网络版本 编辑:程序博客网 时间:2024/05/17 22:09
使用 algorithm 中的 transform:
#include <string>#include <algorithm>#include <iostream>int main(){ std::string str = "FrancisHe"; std::transform(str.begin(), str.end(), str.begin(), ::toupper); std::cout << str << std::endl; std::transform(str.begin(), str.end(), str.begin(), ::tolower); std::cout << str << std::endl; return 0;}
注意:toupper/tolower 不要用 std::xxx, 否则在 Linux 下回编译通不过,因为 Linux 下 std::xxx 是用宏实现的。
0 0
- C C++ 字符串大小写转换
- C++ 字符串大小写转换
- C语言字符串中大小写字母转换
- 字符串大小写转换
- 字符串转换大小写方法
- c++字符串大小写转换
- c++字符串大小写转换
- delphi 大小写字符串转换
- c++字符串大小写转换
- python 字符串 大小写转换
- 字符串大小写转换
- delphi 大小写字符串转换
- c++字符串大小写转换
- c++字符串大小写转换
- 指针转换字符串大小写
- JS字符串大小写转换
- 字符串大小写转换
- 【python】 字符串转换大小写
- 基于最大熵模型的文本分类探讨
- UE4关于Oculus Rift (VR)开发忠告
- vc 消息与事件的区别 转载
- Python学习05--多线程编程
- 接口和抽象类的前世今生
- C++ 字符串大小写转换
- netstat 使用详解
- iOS7默认状态栏文字颜色
- 曾经不懂,是因为阅历和积累不够
- Python编程规范(PEP8)阅读摘要
- hibernate主键
- 思科CCNA第一学期期末考试答案
- LeetCode Solutions : Find Minimum in Rotated Sorted Array
- Ubuntu下安装配置 JDK 7