class11-cs-ch10-(part2)
class11-cs-ch10-(part2)
Computer Science(083)
1
STRING FUNCTIONS :
2
index()
find()
Contd…
4
•startwith() : this function returns True if the string starts with the substring sub , otherwise
returns False.
>>> ABCD.startswith(“A”)
True
•endswith() : this function returns True if the string ends with the substring sub , otherwise
returns False.
>>> ABCD.endswith(“A”)
False
>>>ABCD.endswith(“CD”)
Single Character Functions:
13