I want to know how does rstrip and lstrip works in python. Say, if I have a string
>> a = 'thisthat'
>> a.rstrip('hat')
out : 'this'
>> a.lstrip('this')
out: 'at'
>> a.rstrip('cat')
out: 'thisth'
How does stripping a word works?
Ideally output should be "thist"(for first case) and 'that'(for second case) right?
Or is it like regular expression, matching each character, and whichever char it sees at the end it strips off (for third case)?
Note: I'm not looking for replace I just want to know how strip works while stripping a substring from the string.