Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #22045
| Subject | Odd strip behavior |
|---|---|
| From | Rodrick Brown <rodrick.brown@gmail.com> |
| Date | 2012-03-22 15:48 -0400 |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.903.1332445730.3037.python-list@python.org> (permalink) |
#!/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
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Odd strip behavior Rodrick Brown <rodrick.brown@gmail.com> - 2012-03-22 15:48 -0400 Re: Odd strip behavior Kiuhnm <kiuhnm03.4t.yahoo.it> - 2012-03-22 20:56 +0100
csiph-web