Posted on 26th April 2024
Split:
This split function will split the string from the positions wherever the provided pattern occurs and returns a list of strings like this:
mystr = “welcomebtobthisbpage”
pattern = “b”
mystr = mystr.split(pattern)
Output:
mystr
[‘welcome', 'to', 'this', 'page']
Strip:
This function will remove the provided inputs from both the ends of the given string that is from staring and ending position the string like this:
mystr = "bheyb"
mystr = mystr.strip("b")
Output:
mystr
'hey'
STILL GOT QUERIES?