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">

Presentation is loading. Please wait.

Presentation is loading. Please wait.

string functions isspace() – used to check the string is space x= “ "

Similar presentations


Presentation on theme: "string functions isspace() – used to check the string is space x= “ ""— Presentation transcript:

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


Download ppt "string functions isspace() – used to check the string is space x= “ ""

Similar presentations


Ads by Google