True istitle() – check whether the string is in title case x= “I Like Computer“ print x.istitle() ->True"> True istitle() – check whether the string is in title case x= “I Like Computer“ print x.istitle() ->True">
Download presentation
Presentation is loading. Please wait.
Published byLewis Shelton Modified over 5 years ago
1
Topic- String functions – isspace(),istitle(),lstrip(),rstrip(), capitalize()
2
string functions isspace() – used to check the string is space x= “ "
print x.isspace() ->True istitle() – check whether the string is in title case x= “I Like Computer“ print x.istitle() ->True
3
string functions lstrip() – removes extra space from left. x= “ book "
print x.lstrip() OUTPUT book rstrip() – removes extra space from right. x= “ book " print x.rstrip()
4
string functions lstrip(CHAR) – removes particular character from left. x= “ xxbookxx" print x.lstrip(‘x’) OUTPUT bookxx rstrip(CHAR) – removes particular character from right. x= “ xxbookxx“ print x.rstrip(‘x’) xxbook
5
string functions lstrip(string ) x= “ there" print x.lstrip(‘ht’)
rstrip(string ) print x.rstrip(‘er’)
6
string functions capitalize() – converts the first letter to upper case. x= “computer science " print x.capitalize() OUTPUT Computer science
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.