Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'api.': 0.05; 'completeness': 0.05; 'main()': 0.05; 'behavior,': 0.07; 'defaults': 0.07; 'does.': 0.07; 'specifying': 0.07; '__name__': 0.09; 'prefix': 0.09; 'trailing': 0.09; 'message-----': 0.12; 'def': 0.13; 'argument': 0.15; 'to:name:python-list@python.org': 0.15; "'__main__':": 0.16; '2.2.2:': 0.16; '712': 0.16; 'currencies': 0.16; 'disclaimers': 0.16; 'disclaimers,': 0.16; 'from:addr:jpmorgan.com': 0.16; 'main():': 0.16; 'received:155.180': 0.16; 'received:159.53': 0.16; 'received:bankone.net': 0.16; 'received:exchad.jpmchase.net': 0.16; 'received:jpmchase.com': 0.16; 'received:jpmchase.net': 0.16; 'received:svr.bankone.net': 0.16; 'securities,': 0.16; 'spacious': 0.16; 'stripped:': 0.16; 'subject:behavior': 0.16; 'suffix;': 0.16; 'url:disclosures': 0.16; 'url:jpmorgan': 0.16; 'whitespace.': 0.16; '>>>': 0.18; 'header:In-Reply-To:1': 0.22; 'changed': 0.23; 'string': 0.24; 'removed.': 0.24; 'url:mailman': 0.27; 'received:169': 0.28; 'received:169.254': 0.28; 'odd': 0.29; "skip:' 30": 0.29; 'print': 0.29; '22,': 0.30; 'none,': 0.30; 'omitted': 0.30; 'received:155': 0.30; 'received:159': 0.30; 'url:library': 0.31; 'url:listinfo': 0.32; 'version': 0.32; 'values': 0.32; 'accuracy': 0.32; 'familiar': 0.32; 'it.': 0.33; 'skip:# 10': 0.34; 'to:addr:python-list': 0.35; 'phone:': 0.35; 'subject:': 0.35; 'url:python': 0.35; 'skip:p 50': 0.37; 'charset :us-ascii': 0.37; 'listed': 0.38; 'sent:': 0.38; 'characters': 0.39; 'url:org': 0.39; 'from:': 0.40; 'to:addr:python.org': 0.40; 'march': 0.61; 'subject': 0.61; 'offers': 0.62; 'leading': 0.62; 'iphone': 0.68; 'become': 0.69; 'information,': 0.69; 'legal': 0.72; 'url:email': 0.72; 'bank': 0.75; 'sale': 0.75; 'investment': 0.77; 'purchase': 0.78; 'brown': 0.80; 'received:169.254.8': 0.84 X-DKIM: OpenDKIM Filter v2.1.3 sz1.jpmchase.com q2MJsjZ7008342 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=jpmorgan.com; s=smtpout; t=1332446086; bh=w8nyQ4pONn4Ob0mUNHZBd28VYlEu1IeDHDmpIHccGwI=; h=From:To:Subject:Date:Message-ID:References:In-Reply-To: Content-Transfer-Encoding:MIME-Version:Content-Type; b=kORXlLQqJXBbI7CocKzlnB9ujQbgrQr/gkoOIn0RNFBhxRXz/S715cPMDITJomXR6 yO3QkuRbnLdz5LAXpGM0UOSd8eV3iDlu4ExQQSsdVOS34fsT9seQTSRE+BzBxf2lLX xVCM9A/HxG8KbD/pbBgXJFd6dML2PECojLH4Zams= From: "Prasad, Ramit" To: "python-list@python.org" Subject: RE: Odd strip behavior Thread-Topic: Odd strip behavior Thread-Index: AQHNCGTToUORfkWu+0Ww1H6LCvJUfZZ2uPkw Date: Thu, 22 Mar 2012 19:54:37 +0000 References: <5B2CBFB0-DC2D-47E1-978F-59E47EB3A757@gmail.com> In-Reply-To: <5B2CBFB0-DC2D-47E1-978F-59E47EB3A757@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.67.79.38] Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-DLP-FWD: Yes Content-Type: text/plain; charset="us-ascii" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1332446094 news.xs4all.nl 6922 [2001:888:2000:d::a6]:34635 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:22047 > str1=3D'this is a test'=0D=0A> str2=3D't'=0D=0A> =0D=0A> prin= t ""=2Ejoin([ c for c in str1 if c not in str2 ])=0D=0A> print(str1=2Es= trip(str2))=0D=0A> =0D=0A> if __name__ =3D=3D '__main__':=0D=0A> main()= =0D=0A> =0D=0A> =2E/remove_str=2Epy=0D=0A> his is a es=0D=0A> his is a tes= =0D=0A> =0D=0A> Why wasnt the t removed ?=0D=0A=0D=0AThis is not odd behavi= or, you just do not understand what=0D=0Astrip does=2E :)=0D=0A=0D=0AThe be= havior is listed on the API=2E I highly recommend you =0D=0Atake time to be= come familiar with it=2E =0D=0A=0D=0A=0D=0Ahttp://docs=2Epython=2Eorg/libra= ry/stdtypes=2Ehtml#string-methods=0D=0Astr=2Estrip([chars])=0D=0A Return= a copy of the string with the leading and trailing characters removed=2E T= he chars argument is a string specifying the set of characters to be remove= d=2E If omitted or None, the chars argument defaults to removing whitespace= =2E The chars argument is not a prefix or suffix; rather, all combinations = of its values are stripped:=0D=0A >>>=0D=0A >>> ' spacious '=2Est= rip()=0D=0A 'spacious'=0D=0A >>> 'www=2Eexample=2Ecom'=2Estrip('cmowz= =2E')=0D=0A 'example'=0D=0A=0D=0A=0D=0A Changed in version 2=2E2=2E2:= Support for the chars argument=2E=0D=0A=0D=0ARamit=0D=0A=0D=0A=0D=0ARamit = Prasad | JPMorgan Chase Investment Bank | Currencies Technology=0D=0A712 Ma= in Street | Houston, TX 77002=0D=0Awork phone: 713 - 216 - 5423=0D=0A=0D=0A= --=0D=0A=0D=0A=0D=0A> -----Original Message-----=0D=0A> From: python-list-b= ounces+ramit=2Eprasad=3Djpmorgan=2Ecom@python=2Eorg=0D=0A> [mailto:python-l= ist-bounces+ramit=2Eprasad=3Djpmorgan=2Ecom@python=2Eorg] On Behalf=0D=0A> = Of Rodrick Brown=0D=0A> Sent: Thursday, March 22, 2012 2:49 PM=0D=0A> To: p= ython-list@python=2Eorg=0D=0A> Subject: Odd strip behavior=0D=0A> =0D=0A> #= !/usr/bin/python=0D=0A> =0D=0A> def main():=0D=0A> =0D=0A> Sent from my iPh= one=0D=0A> --=0D=0A> http://mail=2Epython=2Eorg/mailman/listinfo/python-lis= t=0D=0AThis email is confidential and subject to important disclaimers and= =0D=0Aconditions including on offers for the purchase or sale of=0D=0Asecur= ities, accuracy and completeness of information, viruses,=0D=0Aconfidential= ity, legal privilege, and legal entity disclaimers,=0D=0Aavailable at http:= //www=2Ejpmorgan=2Ecom/pages/disclosures/email=2E