#include <string>
#include <algorithm>
using namespace std;
int main()
{
string strA = "yasaken@126.com";
string strB = "LURY@LENOVO.com";
printf("Before transform:\n");
printf("strA:%s \n", strA.c_str());
printf("strB:%s \n\n", strB.c_str());
transform(strA.begin(), strA.end(), strA.begin(), ::toupper);
transform(strB.begin(), strB.end(), strB.begin(), ::toupper);
printf("After transform to toupper:\n");
printf("strA:%s \n", strA.c_str());
printf("strB:%s \n\n", strB.c_str());
transform(strA.begin(), strA.end(), strA.begin(), ::tolower);
transform(strB.begin(), strB.end(), strB.begin(), ::tolower);
printf("After transform to lower:\n");
printf("strA:%s \n", strA.c_str());
printf("strB:%s \n\n", strB.c_str());
return 0;
}
string 大小写转换
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
上一篇:小型的Unix系统字符SHELL
下一篇:string 大小写转换
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
mysql8.0大小写的坑
这两天又被mysql8.0大小写的问题坑到了,看下面的报错:chown: cannot access './proc/38/fd/6': No such file or directorychown: cannot access './proc/38/fd/7': No such file or directorychown: cannot access './proc/38/fdinfo
lower_case_table_nam my.cnf mysql8.0 chown not permmit -
Mysql8.0.35rpm安装(不区分大小写、弱密码规则)
mysql8.0.23rpm安装
mysql 初始化 数据库 部署 -
C++: string的大小写转换
#include <string>#include <algorithm>using namesp
c++ c语言 开发语言 #include -
python 大小写转换
le/details/52695089大写: 把所
字符转换 .net