- rstrip() is a python in-build function which are used to delete the specified content at the right side of the string
- it take one string as an argument which we want to remove from the right portion of the given string.
Syntax-
str.rstrip(chars)
Example
string is s="this is string"
and s.rstrip("string") will return "this is"
program-
s="This is string"
print(s.rstrip('string'))
s="11111111111mgs"
print(s.lstrip('mgs'))
s="-----this is string-------"
print(s.rstrip("-"))
s="-----this is string-------"
print(s.lstrip("this"))
This is
11111111111mgs
-----this is string
-----this is string-------