Copyright © tutorialspoint.com

Python String capitalize() Method

previous next


Description:

This method returns a copy of the string with only its first character capitalized. For 8-bit strings, this method is locale-dependent.

Syntax:

str.capitalize()

Parameters:

Here is the detail of parameters:

Return Value:

It returns a copy of the string with only its first character capitalized

Example:

#!/usr/bin/python

str = "this is string example....wow!!!";

print "str.capitalize() : ", str.capitalize()

This will produce following result:

str.capitalize() :  This is string example....wow!!!

previous next

Copyright © tutorialspoint.com