Python String istitle() Methods


Contents

Description

The istitle() method in Python String checks if every case-based characters following non-casebased letters in the string are uppercase and the rest are case-based characters are lowercase. The istitle() method in Python does not take any parameters.

Syntax

Here is the syntax for istitle() method:

str.istitle()

Parameters

  • NA

Return Value

This method returns true when the string is a title case string and there lies at least one character, for instance, the uppercase characters might only follow the uncased characters and the lowercase characters may follow only the cased ones. It otherwise returns false.

Example

The example below shows the usage of istitle() method.

#!/usr/bin/python

str = "This Is String Example...Wow!!!";
print str.istitle()

str = "This is string example....wow!!!";
print str.istitle()

When the above program is run, it produces the following result:

True
False

Here at Intellinuts, we have created a complete Python tutorial for Beginners to get started in Python.



Navigation
Tutorial
Tutorial
Tutorial