Python String isspace() Method
The Python isspace() method detects whether a string consists of only whitespace characters.
Python String isspace() Syntax
isspace() method syntax.
str.isspace()
Python String isspace() Parameters
- None.
Python String isspace() Return Value
Returns True if the string contains only spaces, otherwise returns False.
Python String isspace() Example#1
The following example shows an example of the isspace() method.
#!/usr/bin/python3
str1 = " "
print (str1.isspace())
str1 = "Apidemos example....wow!"
print (str1.isspace())
Output: