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

std::tolower(std::locale)

Defined in header <locale>

?

?

template< class charT > charT tolower( charT ch, const locale& loc );

?

?

转换字符ch如果可能的话,使用由给定的区域设置%27所指定的转换规则,以小写std::ctype小面。

参数

ch

-

character

loc

-

locale

返回值

返回小写形式的ch如果在区域设置中列出了一个,则返回ch没有变化。

注记

这个函数只能执行01:1的字符映射,例如,希腊大写字母%27Σ%27有两个小写形式,取决于单词中的位置:%27σ%27和%27%100。打电话给std::tolower在这种情况下,无法使用它获得正确的小写形式。

可能的实施

模板<类图表>图表收费者%28图表ch,Const std::locale&loc%29{返回std::use[医]facet<std::Ctype<charT>>%28 loc%29。收费器%28 ch%29;}

*。

二次

代码语言:javascript
复制
#include <iostream>
#include <cwctype>
#include <locale>
 
int main()
{
    wchar_t c = L'\u0190'; // Latin capital open E ('?')
 
    std::cout << std::hex << std::showbase;
 
    std::cout << "in the default locale, tolower(" << (std::wint_t)c << ") = "
              << std::tolower(c, std::locale()) << '\n';
 
    std::cout << "in Unicode locale, tolower(" << (std::wint_t)c << ") = "
              << std::tolower(c, std::locale("en_US.utf8")) << '\n';
}

二次

产出:

二次

代码语言:javascript
复制
in the default locale, tolower(0x190) = 0x190
in Unicode locale, tolower(0x190) = 0x25b

二次

另见

toupper(std::locale)

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

tolower

converts a character to lowercase (function)

towlower

converts a wide character to lowercase (function)

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

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

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com