首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

std::tolower

Defined in header <cctype>

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语言环境中没有列出小写版本。

二次

代码语言:javascript
复制
#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';
}

二次

产出:

二次

代码语言:javascript
复制
in iso8859-1, tolower('0xb4') gives 0xb4
in iso8859-15, tolower('0xb4') gives 0xb8

二次

另见

toupper

converts a character to uppercase (function)

tolower(std::locale)

converts a character to lowercase using the ctype facet of a locale (function template)

towlower

converts a wide character to lowercase (function)

c收费人文件

代码语言:txt
复制
 © cppreference.com

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

扫码关注腾讯云开发者

领取腾讯云代金券