11 String 11 Nov
11 String 11 Nov
title() Returns the string with first letter >>> str1 = 'hello WORLD!' >>>
of every word in the string in str1.title()
uppercase and rest in lowercase 'Hello World!'
lower() Returns the string with all >>> str1 = 'hello WORLD!' >>>
uppercase letters converted to str1.lower()
lowercase 'hello world!'
upper() Returns the string with all >>> str1 = 'hello WORLD!' >>>
lowercase letters converted to str1.upper()
uppercase 'HELLO WORLD!'
count(str, start, end) Returns number of times substring >>> str1 = 'Hello World! Hello
str occurs in the given string. If we Hello'
do not give start index and end >>> str1.count('Hello',12,25) 2
index then searching starts from >>> str1.count('Hello')
index 0 and ends at length of the 3
string