New submission from Chris Rogers <chihuahuasare2c...@gmail.com>:
Consider this string: 'mailto:mailto:mailto:m...@example.com' If you try to remove the mailtos with lstrip('mailto:'), you'll be left with this: 'n...@example.com' That's because the three strip functions look at each character separately rather than as a whole string. Currently, as a workaround, you have to either use regex or a loop. This can take several lines of code. It would be great if the strip functions had a second parameter that lets you keep the first parameter intact. You could then use this code to get the desired result: 'mailto:mailto:mailto:m...@example.com'.lstrip('mailto:', true) >>m...@example.com ---------- messages: 361791 nosy: Chris Rogers priority: normal severity: normal status: open title: Add a parameter to strip, lstrip, and rstrip that treats the first parameter as a full string type: enhancement _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue39607> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com