Compartilhar via


isupper

Testa se um elemento em um local está em maiúscula.

template<Class CharType>
   bool isupper(
      CharType _Ch, 
      const locale& _Loc
   )

Parâmetros

  • _Ch
    o elemento a ser testado.

  • _Loc
    A localidade que contém o elemento a ser testado.

Valor de retorno

true se o elemento testado é um caractere maiúsculo; false se não é.

Comentários

A função do modelo retorna use_facet<ctype<CharType> >(_Loc).is(ctype<CharType>::upper, _Ch).

Exemplo

// locale_isupper.cpp
// compile with: /EHsc
#include <locale>
#include <iostream>

using namespace std;

int main( )   
{
   locale loc ( "German_Germany" );
   bool result1 = isupper ( 'L', loc );
   bool result2 = isupper ( 'n', loc );
   bool result3 = isupper ( '3', loc );

   if ( result1 )
      cout << "The character 'L' in the locale is "
           << "a uppercase character." << endl;
   else
      cout << "The character 'L' in the locale is "
           << " not a uppercase character." << endl;

   if ( result2 )
      cout << "The character 'n' in the locale is "
           << "a uppercase character." << endl;
   else
      cout << "The character 'n' in the locale is "
           << " not a uppercase character." << endl;

   if ( result3 )
      cout << "The character '3' in the locale is "
           << "a uppercase character." << endl;
   else
      cout << "The character '3' in the locale is "
           << " not a uppercase character." << endl;
}

Saída

The character 'L' in the locale is a uppercase character.
The character 'n' in the locale is  not a uppercase character.
The character '3' in the locale is  not a uppercase character.

Requisitos

Cabeçalho: <locale>

namespace: STD