forked from WebJournal/journaldev
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
python string isspace() function examples
- Loading branch information
Pankaj Kumar
committed
Dec 18, 2018
1 parent
3141dcd
commit 00da340
Showing
1 changed file
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
s = ' ' | ||
print(s.isspace()) | ||
|
||
s = '\t\n\r\t ' | ||
print(s.isspace()) | ||
|
||
s = '\u0009\t\u200a \u3000' | ||
print(s.isspace()) | ||
|
||
import unicodedata | ||
|
||
count = 0 | ||
for codepoint in range(2 ** 16): | ||
ch = chr(codepoint) | ||
if ch.isspace(): | ||
print(u'{:04x}: ({})'.format(codepoint, unicodedata.name(ch, 'UNNAMED'))) | ||
count = count + 1 | ||
print(f'Total Number of Space Unicode Characters = {count}') |