classification
Title: '''3,5'''.strip(r''',''') does not strip comma, returns '3,5'
Type: behavior Stage: resolved
Components: None Versions: Python 3.1
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: eric.smith, mgruen, r.david.murray
Priority: low Keywords:

Created on 2009-08-14 21:36 by mgruen, last changed 2009-08-14 21:57 by eric.smith. 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
2009-08-14 21:57:40eric.smithsetnosy: + eric.smith
messages: + msg91574
2009-08-14 21:43:02r.david.murraysetstatus: open -> closed
priority: low


nosy: + r.david.murray
messages: + msg91573
resolution: not a bug
stage: resolved
2009-08-14 21:36:36mgruencreate