Definition
The istitle() method returns True
if all words in a text start with a upper case letter, AND the rest of the word are lower case letters, otherwise False
. Symbols and numbers are ignored.
Syntax
string.istitle()
Parameters
No Parameters.
Examples:
testStr = "Welcome To The Python Tutorials!"
result = testStr.istitle()
print(result)
# other examples
testStr = "WELCOME TO THE PYTHON TUTORIALS!"
result = testStr.istitle()
print(result)
testStr = "22 Names!"
result = testStr.istitle()
print(result)
testStr = "This Is %'!?"
result = testStr.istitle()
print(result)