Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.013 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'subject:skip:s 10': 0.05; 'bug': 0.10; '"this': 0.13; '2.7': 0.13; '!!!!': 0.16; "'this": 0.16; '(64': 0.16; 'os:': 0.16; 'cheers,': 0.23; 'message- id:@mail.gmail.com': 0.27; 'colon': 0.29; 'skip:& 10': 0.29; 'print': 0.32; 'ubuntu': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'text': 0.34; 'wrong': 0.34; 'doing': 0.35; 'something': 0.35; 'to:addr:python.org': 0.39; '"");': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=VMhxDjuf+YVpl/rXvEUdtGzL+O+RTZR1hZY4k/SCD+g=; b=iXRdyhp6jAbIdm919CY8oDhHwAuLsdzPYs8DNpJMLFPkdNhOIU43Ys+5f6sVSJksmP sXq6L+uVRi8Cudmd9y2gbQ96oP+9VB+AAsToibBW8br6KYv0hQ0W7OOiCM8IGhTAMxZm b5HFKGW+0W18OClQLoiO0KvwT//yL3vHhwzmGJVW8scW37bljABJQqrFHwKBC3jWAA2C wuU8wAwgfEwxx/fUbLxz+/VMGeSwLILOUm3COK/ep+pa6GbnbATEfxUIFUZ7cHbQ+WLk Ao4IYrrl+OOqcWlSXrjj0/c72m0ShcKvJuncHRB+NsgN8WwO+dIgMc7sjajQzOnrTJPe o9/w== MIME-Version: 1.0 X-Received: by 10.50.197.131 with SMTP id iu3mr7470079igc.109.1360407858735; Sat, 09 Feb 2013 03:04:18 -0800 (PST) Date: Sat, 9 Feb 2013 06:04:18 -0500 Subject: string.replace doesn't removes ":" From: Joshua Robinson To: python-list@python.org Content-Type: multipart/alternative; boundary=14dae93409c12b6c0c04d548a353 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1360407866 news.xs4all.nl 6862 [2001:888:2000:d::a6]:56457 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:38504 --14dae93409c12b6c0c04d548a353 Content-Type: text/plain; charset=ISO-8859-1 Hi *Monte-Pythons*, x = "this is a simple : text: that has colon" s = x.replace(string.punctuation, ""); OR s = x.replace(string.punctuation, ""); print x # 'this is a simple : text: that has colon' # The colon is still in the text !!!! Is this a bug or am I doing something wrong ? Py.Version: 2.7 OS: Ubuntu 12.10 (64 bits) Cheers, -Joshua --14dae93409c12b6c0c04d548a353 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi Monte-Pythons,

x =3D "this is a simple : text: t= hat has colon"
s =3D x.replace(string.punctuation, "");= =A0 OR
s =3D x.replace(string.punctuation, "");
print x=A0= =A0 # 'this is a simple : text: that has colon'
# The colon is still in the text !!!!

Is this a bug or am I doing so= mething wrong ?

Py.Version: 2.7
OS: Ubuntu 12.10 (64 bits)
Cheers,
-Joshua
--14dae93409c12b6c0c04d548a353--