std::isblank<div class="t-tr-text">(Std :: locale)<div class="t-tr-dropdown"><div><div><div class="t-tr-dropdown-arrow-border"></div><div class="t-tr-dropdown-arrow"></div><div class="t-tr-dropdown-h">Original:</div><div class="t-tr-dropdown-orig">(std::locale)</div><div class="t-tr-dropdown-notes">The text has been machine-translated via [http://translate.google.com Google Translate].<br/> You can help to correct and verify the translation. Click [http://en.cppreference.com/w/Cppreference:MachineTranslations here] for instructions.</div></div></div></div></div>
Da cppreference.com.
|
|
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
<metanoindex/>
<tbody> </tbody>| Elemento definito nell'header <locale>
|
||
template< class charT > bool isblank( charT ch, const locale& loc ); |
(dal C++11) | |
Controlla se il carattere dato è classificato come uno spazio vuoto da facet ctype impostazioni internazionali di data.
Original:
Checks if the given character is classified as a blank character by the given locale's ctype facet.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Parametri
| ch | - | carattere
Original: character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| loc | - | locale
Original: locale The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
Valore di ritorno
Restituisce
true se il personaggio è classificato come uno spazio vuoto, false altrimenti.Original:
Returns
true if the character is classified as a blank character, false otherwise.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Possibile implementazione
template< class charT >
bool isblank( charT ch, const std::locale& loc ) {
return std::use_facet<std::ctype<charT>>(loc).is(std::ctype_base::blank, ch);
}
|
Esempio
Viene illustrato l'utilizzo di ISBLANK () con diverse impostazioni internazionali (OS-specifico) .
Original:
Demonstrates the use of isblank() with different locales (OS-specific).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
#include <iostream>
#include <locale>
template< class charT >
void try_with(wchar_t c, const char* loc)
{
std::wcout << "isblank('" << c << "', locale(\"" << loc << "\")) returned " << std::boolalpha
<< std::isblank(c, std::locale(loc)) << '\n';
}
int main()
{
const wchar_t IDEO_SPACE = L'\u3000'; // Unicode character 'IDEOGRAPHIC SPACE'
try_with(IDEO_SPACE, "C");
try_with(IDEO_SPACE, "en_US.UTF-8");
}
Output:
isblank(' ', locale("C")) returned false
isblank(' ', locale("en_US.UTF-8")) returned true
Vedi anche
(C++11) |
Verifica se un carattere è un carattere vuoto Original: checks if a character is a blank character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione) |
(C++11) |
Verifica se un carattere esteso è un carattere vuoto Original: checks if a wide character is a blank character The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (funzione) |