Saturday, March 10, 2018

String title() Method


String title() Method in Python 3


The title() method returns a copy of the string in which first characters of all the words are capitalized.

Syntax
str.title();

Return Value
This method returns a copy of the string in which first characters of all the words are capitalized.

Example
#!/usr/bin/python3
str = "this is string example....wow!!!"
print (str.title())

Result
This Is String Example....Wow!!!