ctype::tolower

Converts a character or a range of characters to lower case.

CharType tolower(
     CharType _Ch
) const;
const CharType *tolower(
      CharType* _First, 
      const CharType* _Last,
) const;

Parameters

  • _Ch
    The character to be converted to lower case.

  • _First
    A pointer to the first character in the range of characters whose cases are to be converted.

  • _Last
    A pointer to the last character in the range of characters whose cases are to be converted.

Return Value

The first member function returns the lowercase form of the parameter character. If no lowercase form exists, it returns the parameter character.

The second member function returns a constant pointer to the last character in the converted range of characters.

Remarks

The first member function returns do_tolower(_Ch). The second member function returns do_tolower(_First, _Last).

Example

// 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[0], &string[strlen(&string[0])-1] );
   cout << "The lowercase string is: " << string << endl;
}

The lowercase string is: hello, my name is john!

Requirements

Header: <locale>

Namespace: std

See Also

Concepts

ctype Class

ctype Members