Issue 6705: '''3,5'''.strip(r''',''') does not strip comma, returns '3,5' (original) (raw)

Issue6705

Created on 2009-08-14 21:36 by mgruen, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg91572 - (view) Author: Michael Gruen (mgruen) Date: 2009-08-14 21:36
I am new, I apologize if this is a trivial or non-problem. I have researched for hours, tried every variant but cannot understand why this doesn't work.
msg91573 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-08-14 21:43
strip removes any of a set of characters from the beginning and end of a string, not the middle. Please refer questions such as this to python-list or python-tutor. There are many helpful people on those lists who will help you learn your way around python.
msg91574 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2009-08-14 21:57
Good advice from R. David. In addition, you'll find the help command useful: >>> help(''.strip) Help on built-in function strip: strip(...) S.strip([chars]) -> string or unicode Return a copy of the string S with leading and trailing whitespace removed. If chars is given and not None, remove characters in chars instead. If chars is unicode, S will be converted to unicode before stripping
History
Date User Action Args
2022-04-11 14:56:51 admin set github: 50954
2009-08-14 21:57:40 eric.smith set nosy: + eric.smithmessages: +
2009-08-14 21:43:02 r.david.murray set status: open -> closedpriority: lownosy: + r.david.murraymessages: + resolution: not a bugstage: resolved
2009-08-14 21:36:36 mgruen create