Message361791
Consider this string:
'mailto:mailto:mailto:main@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:main@example.com'.lstrip('mailto:', true)
>>main@example.com |
|
Date |
User |
Action |
Args |
2020-02-11 09:40:20 | Chris Rogers | set | recipients:
+ Chris Rogers |
2020-02-11 09:40:20 | Chris Rogers | set | messageid: <1581414020.64.0.469287582867.issue39607@roundup.psfhosted.org> |
2020-02-11 09:40:20 | Chris Rogers | link | issue39607 messages |
2020-02-11 09:40:20 | Chris Rogers | create | |
|