Skip to content

Commit

Permalink
python string isspace() function examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Pankaj Kumar committed Dec 18, 2018
1 parent 3141dcd commit 00da340
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Python-3/basic_examples/strings/string_isspace.py
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}')

0 comments on commit 00da340

Please sign in to comment.