Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to check if a string contains spaces in python

#isspace() is a built-in method used for string handling
string = "My name is"
print(string.isspace())
#It will print True

string = "Hello"
print(string.isspace())
#It will print True
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #check #string #spaces #python
ADD COMMENT
Topic
Name
7+4 =