Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Odd strip behavior

Reply
Thread Tools

Odd strip behavior

 
 
Rodrick Brown
Guest
Posts: n/a
 
      03-22-2012
#!/usr/bin/python

def main():

str1='this is a test'
str2='t'

print "".join([ c for c in str1 if c not in str2 ])
print(str1.strip(str2))

if __name__ == '__main__':
main()

../remove_str.py
his is a es
his is a tes

Why wasnt the t removed ?
Sent from my iPhone
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
strip all but second second line from bottom and then strip that!!!! yelipolok Perl Misc 4 01-27-2010 08:14 AM
pretty strange behavior of "strip" Guy Doune Python 0 12-04-2008 11:35 PM
Odd behavior with odd code Michael Speer C Programming 33 02-18-2007 07:31 AM
VERY odd routing behavior when attempting VPN connections over Wifi Robert Gordon Wireless Networking 0 08-25-2005 04:04 PM
strip and its evil brother strip! Aquila Ruby 35 03-31-2005 04:10 AM



Advertisments