Python - String istitle() Method


Advertisements

The string istitle() method is used to check whether all characters of the string are in title format or not. It returns true when all characters of the string are in title format, else returns false. A title format consists of first character of each word in uppercase and rest in lower case. Any symbol, space, or number in the string is ignored while applying this method. Only alphabet are checked.

Syntax


string.istitle()

Parameters

No parameter is required.

Example:

In the below example, istitle() method checks whether all characters of the given string are in title format or not. It only checks alphabet. Any symbol, space, or number in the string is ignored while applying istitle() method.

MyString = "Hello World!"
print(MyString.istitle())

MyString = "Hello world"
print(MyString.istitle())

MyString = "@Hello World"
print(MyString.istitle())

Output

True    

False  

True

String Methods
Advertisements