title()
title(): Change First letter of each word to upper case
my_str='welcome to plus2net python section'
output=my_str.title()
print(output)
my_str='welcome #id 15of plus2net'
output=my_str.title()
print(output)
Output
Welcome To Plus2Net Python Section
Welcome #Id 15Of Plus2Net
This also changes the first char after any number of special chars ( check plus2Net )
« All String methods
← Subscribe to our YouTube Channel here
This article is written by plus2net.com team.
https://www.plus2net.com
plus2net.com