std:: islower (std::locale)
From cppreference.net
C++
Text processing library
| Localization library | |||||||||||||||||||||||||
| Regular expressions library (C++11) | |||||||||||||||||||||||||
| Formatting library (C++20) | |||||||||||||||||||||||||
| Null-terminated sequence utilities | |||||||||||||||||||||||||
| Byte strings | |||||||||||||||||||||||||
| Multibyte strings | |||||||||||||||||||||||||
| Wide strings | |||||||||||||||||||||||||
| Primitive numeric conversions | |||||||||||||||||||||||||
|
|||||||||||||||||||||||||
| Text encoding identifications | |||||||||||||||||||||||||
|
|||||||||||||||||||||||||
Localization library
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Definiert in Header
<locale>
|
||
|
template
<
class
CharT
>
bool islower ( CharT ch, const locale & loc ) ; |
||
Überprüft, ob das gegebene Zeichen gemäß der std::ctype Facette der gegebenen Locale als Kleinbuchstabe klassifiziert wird.
Inhaltsverzeichnis |
Parameter
| ch | - | Zeichen |
| loc | - | Gebietsschema |
Rückgabewert
Gibt true zurück, wenn das Zeichen als Kleinbuchstabe klassifiziert ist, false andernfalls.
Mögliche Implementierung
template<class CharT> bool islower(CharT ch, const std::locale& loc) { return std::use_facet<std::ctype<CharT>>(loc).is(std::ctype_base::lower, ch); } |
Beispiel
Demonstriert die Verwendung von
islower()
mit verschiedenen Locales (betriebssystemspezifisch).
Diesen Code ausführen
#include <iostream> #include <locale> int main() { const wchar_t c = L'\u03c0'; // GREEK SMALL LETTER PI std::locale loc1("C"); std::cout << std::boolalpha << "islower('π', C locale) returned " << std::islower(c, loc1) << '\n' << "isupper('π', C locale) returned " << std::isupper(c, loc1) << '\n'; std::locale loc2("en_US.UTF8"); std::cout << "islower('π', Unicode locale) returned " << std::islower(c, loc2) << '\n' << "isupper('π', Unicode locale) returned " << std::isupper(c, loc2) << '\n'; }
Mögliche Ausgabe:
islower('π', C locale) returned false
isupper('π', C locale) returned false
islower('π', Unicode locale) returned true
isupper('π', Unicode locale) returned false
Siehe auch
|
prüft, ob ein Zeichen ein Kleinbuchstabe ist
(Funktion) |
|
|
prüft, ob ein Breitzeichen ein Kleinbuchstabe ist
(Funktion) |