isspace()
« All String methods
my_str.isspace()
Returns True
if all chars in a string are white space , otherwise returns False
my_str='Welcome to plus2net'
print(my_str.isspace()) # Output is False
my_str=' '
print(my_str.isspace()) # Output is True
my_str=' \n '
print(my_str.isspace()) # Output is True ( presence of line break \n)
my_str=' \t '
print(my_str.isspace()) # Output is True ( presence of tab \t )
my_str=' com '
print(my_str.isspace()) # Output is False ( presence of string )
« All String methods
← Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
https://www.plus2net.com
plus2net.com