在线文档教程
C++
字符串 | Strings

std::tolower

STD:收费者

Defined in header
int tolower( int ch

根据当前安装的C语言环境定义的字符转换规则将给定字符转换为小写。

在默认的“C”区域设置中,以下大写字母ABCDEFGHIJKLMNOPQRSTUVWXYZ被替换为相应的小写字母。abcdefghijklmnopqrstuvwxyz...

参数

ch-character to be converted. If the value of ch is not representable as unsigned char and does not equal EOF, the behavior is undefined

返回值

小写版本ch或未经修改ch如果在当前C语言环境中没有列出小写版本。

二次

#include <iostream> #include <cctype> #include <clocale> int main() { unsigned char c = '\xb4'; // the character Ž in ISO-8859-15 // but ´ (acute accent) in ISO-8859-1 std::setlocale(LC_ALL, "en_US.iso88591" std::cout << std::hex << std::showbase; std::cout << "in iso8859-1, tolower('0xb4') gives " << std::tolower(c) << '\n'; std::setlocale(LC_ALL, "en_US.iso885915" std::cout << "in iso8859-15, tolower('0xb4') gives " << std::tolower(c) << '\n'; }

二次

产出:

二次

in iso8859-1, tolower('0xb4') gives 0xb4 in iso8859-15, tolower('0xb4') gives 0xb8

二次

另见

toupperconverts a character to uppercase (function)
tolower(std::locale)converts a character to lowercase using the ctype facet of a locale (function template)
towlowerconverts a wide character to lowercase (function)

c收费人文件

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cppreference.com/w/cpp/string/字节/tolower