std::iswblank
From cppreference.com
| Defined in header <cwctype>
|
||
| int iswblank( std::wint_t ch ); |
(since C++11) | |
Checks if the given wide character is classified as blank character (that is, a whitespace character used to separate words in a sentence) by the current C locale. In the default C locale, only space (0x20) and horizontal tab (0x09) are blank characters.
If the value of ch is neither representable as a wchar_t nor equal to the value of the macro WEOF, the behavior is undefined.
Contents |
[edit] Parameters
| ch | - | wide character |
[edit] Return value
Non-zero value if the wide character is a blank character, zero otherwise.
[edit] Notes
ISO 30112 defines POSIX blank characters as Unicode characters U+0009, U+0020, U+1680, U+180E, U+2000..U+2006, U+2008, U+200A, U+205F, and U+3000.
[edit] Example
Run this code
#include <clocale> #include <cwctype> #include <iostream> int main() { wchar_t c = L'\u3000'; // Ideographic space ('γ') std::cout << std::hex << std::showbase << std::boolalpha; std::cout << "in the default locale, iswblank(" << (std::wint_t)c << ") = " << (bool)std::iswblank(c) << '\n'; std::setlocale(LC_ALL, "en_US.utf8"); std::cout << "in Unicode locale, iswblank(" << (std::wint_t)c << ") = " << (bool)std::iswblank(c) << '\n'; }
Output:
in the default locale, iswblank(0x3000) = false in Unicode locale, iswblank(0x3000) = true
[edit] See also
| (C++11) |
checks if a character is classified as a blank character by a locale (function template) |
| (C++11) |
checks if a character is a blank character (function) |
| C documentation for iswblank
| |
| ASCII values | characters |
isblank |
|||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| decimal | hexadecimal | octal | |||||||||||||
| 0β8 | \x0β\x8
|
\0β\10
|
control codes (NUL, etc.)
|
β 0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
| 9 | \x9
|
\11
|
tab (\t)
|
β 0
|
0
|
β 0
|
β 0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
| 10β13 | \xAβ\xD
|
\12β\15
|
whitespaces (\n, \v, \f, \r)
|
β 0
|
0
|
β 0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
| 14β31 | \xEβ\x1F
|
\16β\37
|
control codes | β 0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
| 32 | \x20
|
\40
|
space | 0
|
β 0
|
β 0
|
β 0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
| 33β47 | \x21β\x2F
|
\41β\57
|
!"#$%&'()*+,-./
|
0
|
β 0
|
0
|
0
|
β 0
|
β 0
|
0
|
0
|
0
|
0
|
0
|
0
|
| 48β57 | \x30β\x39
|
\60β\71
|
0123456789
|
0
|
β 0
|
0
|
0
|
β 0
|
0
|
β 0
|
0
|
0
|
0
|
β 0
|
β 0
|
| 58β64 | \x3Aβ\x40
|
\72β\100
|
:;<=>?@
|
0
|
β 0
|
0
|
0
|
β 0
|
β 0
|
0
|
0
|
0
|
0
|
0
|
0
|
| 65β70 | \x41β\x46
|
\101β\106
|
ABCDEF
|
0
|
β 0
|
0
|
0
|
β 0
|
0
|
β 0
|
β 0
|
β 0
|
0
|
0
|
β 0
|
| 71β90 | \x47β\x5A
|
\107β\132
|
GHIJKLMNOPQRSTUVWXYZ
|
0
|
β 0
|
0
|
0
|
β 0
|
0
|
β 0
|
β 0
|
β 0
|
0
|
0
|
0
|
| 91β96 | \x5Bβ\x60
|
\133β\140
|
[\]^_`
|
0
|
β 0
|
0
|
0
|
β 0
|
β 0
|
0
|
0
|
0
|
0
|
0
|
0
|
| 97β102 | \x61β\x66
|
\141β\146
|
abcdef
|
0
|
β 0
|
0
|
0
|
β 0
|
0
|
β 0
|
β 0
|
0
|
β 0
|
0
|
β 0
|
| 103β122 | \x67β\x7A
|
\147β\172
|
ghijklmnopqrstuvwxyz
|
0
|
β 0
|
0
|
0
|
β 0
|
0
|
β 0
|
β 0
|
0
|
β 0
|
0
|
0
|
| 123β126 | \x7Bβ\x7E
|
\172β\176
|
{|}~
|
0
|
β 0
|
0
|
0
|
β 0
|
β 0
|
0
|
0
|
0
|
0
|
0
|
0
|
| 127 | \x7F
|
\177
|
backspace character (DEL)
|
β 0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|
0
|