charT
tolower(charT c) const; // (1) C++98
const charT*
tolower(charT* low,
const charT* high) const; // (2) C++98
概要
小文字に変換する。
- (1) : 文字
cを小文字に変換する - (2) : 範囲
[low, high)の各文字を小文字に変換する
戻り値
- (1) :
do_tolower(c) - (2) :
do_tolower(low, high)
例
#include <iostream>
#include <locale>
#include <string>
int main()
{
const auto& ct = std::use_facet<std::ctype<char>>(std::locale::classic());
// (1)
std::cout << ct.tolower('A') << std::endl;
// (2)
std::string s = "ABC";
ct.tolower(&s[0], &s[0] + s.size());
std::cout << s << std::endl;
}
出力
a
abc
バージョン
言語
- C++98