将字符或字符范围转换为小写。
CharType tolower(
CharType ch
) const;
const CharType *tolower(
CharType* first,
const CharType* last,
) const;
参数
ch
要转换的字符转换为小写。first
对于第一个字符的指针将转换大小写的字符范围内。last
指向字符的指针在将转换大小写的字符范围内的最后一个字符之后。
返回值
第一个成员函数返回参数 ch的小写形式。如果例窗体不存在,则返回 ch。
第二个成员函数返回 last。
备注
第一个成员函数返回 do_tolower(ch)。第二个成员函数返回 do_tolower(first,last)。
示例
// ctype_tolower.cpp
// compile with: /EHsc
#include <locale>
#include <iostream>
using namespace std;
int main( )
{
locale loc1 ( "German_Germany" );
char string[] = "HELLO, MY NAME IS JOHN";
use_facet<ctype<char> > ( loc1 ).tolower
( string, string + strlen(string) );
cout << "The lowercase string is: " << string << endl;
}
要求
标头: <locale>
命名空间: std