字符串到C / C中的下/上 [英] String To Lower/Upper in C++
本文介绍了字符串到C / C中的下/上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
人们在C ++中找到的最好的方式是String到小写/大写?
What is the best way people have found to do String to Lower case / Upper case in C++?
问题是由于C ++不是只有英语的编程语言。是否有很好的多语言方法?
The issue is complicated by the fact that C++ isn't an English only programming language. Is there a good multilingual method?
推荐答案
#include <algorithm>
std::string data = "Abc";
std::transform(data.begin(), data.end(), data.begin(), ::toupper);
http://notfaq.wordpress.com/2007/08/04/cc-convert-string-to-upperlower-case/
此外,CodeProject的常见字符串方法的文章: http://www.codeproject.com/KB/stl/STL_string_util.aspx
Also, CodeProject article for common string methods: http://www.codeproject.com/KB/stl/STL_string_util.aspx
这篇关于字符串到C / C中的下/上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文