[issue45334] String Strip not working

2021-09-30 Thread Steven D'Aprano
Steven D'Aprano added the comment: Serhiy is correct. Please see the documentation. https://docs.python.org/3/library/stdtypes.html#str.strip If you are using version 3.9 or better, you can use removeprefix instead: https://docs.python.org/3/library/stdtypes.html#str.removeprefix --

[issue45334] String Strip not working

2021-09-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It works as intended (please re-read the documentation carefully). It strips all characters specified in the argument. It strips characters "c" and "p" and stops before character "u" because "monitorScript_" contains "c" and "p", but not "u". -- n

[issue45334] String Strip not working

2021-09-30 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- components: -Parser nosy: -pablogsal ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue45334] String Strip not working

2021-09-30 Thread Vigneshwar Elangovan
New submission from Vigneshwar Elangovan : string = "monitorScript_cpu.py" a = string.strip("monitorScript_") print(a) > getting output => u.py Should stip only "monitorScript_" but stripping additional 2 charaters "monitorScript_cp" Below code working fine: string = "monitorScript_send