共用方式為


ctype::tolower

轉換字元的範圍為小寫。

CharType tolower(
    CharType ch
) const;
const CharType *tolower(
    CharType* first, 
    const CharType* last,
) const;

參數

  • ch
    要轉換的字元轉換為小寫。

  • first
    對第一個字元的指標會案例要轉換的字元範圍內。

  • last
    對字元的指標會在這種情況下要轉換的字元範圍內的最後一個字元之後。

傳回值

第 10% 成員函式傳回 ch參數的小寫形式。 如果小寫表單不存在,則傳回 ch。

第二 + 成成員函式會傳回 last。

備註

第 10% 成員函式會傳回 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;
}
  

需求

標題: <地區設定>

命名空間: std

請參閱

參考

ctype 類別