A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2006-May/065010.html below:

[Python-Dev] correction of a bug

[Python-Dev] correction of a bug [Python-Dev] correction of a bugEdward Loper edloper at gradient.cis.upenn.edu
Sun May 14 22:27:50 CEST 2006
draconux wrote:
> 
> Hello all ,
> string.lstrip("source/old_prog","source/") return "ld_prog" instead of 
> "old_prog"

You are misunderstanding what the second argument to lstrip does.  It is 
interpreted as a list of characters; and lstrip will remove the maximal 
prefix of the string that consists of these characters.  E.g.:

 >>> 'aaabbbcccaax'.lstrip('abc')
'x'

The first character in your string that is not one of the characters 
's', 'o', 'u', 'r', 'c', 'e', or '/' is 'l', so it strips all characters 
up to that one.

-Edward
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4