<html><head></head><body bgcolor="#FFFFFF"><div><br></div><div>On Mar 22, 2012, at 3:53 PM, Arnaud Delobelle <<a href="mailto:arnodel@gmail.com">arnodel@gmail.com</a>> wrote:<br><br></div><div></div><blockquote type="cite"><div><p><br>
On Mar 22, 2012 7:49 PM, "Rodrick Brown" <<a href="mailto:rodrick.brown@gmail.com">rodrick.brown@gmail.com</a>> wrote:<br>
><br>
> #!/usr/bin/python<br>
><br>
> def main():<br>
><br>
>    str1='this is a test'<br>
>    str2='t'<br>
><br>
>    print "".join([ c for c in str1 if c not in str2 ])<br>
>    print(str1.strip(str2))<br>
><br>
> if __name__ == '__main__':<br>
>    main()<br>
><br>
> ./remove_str.py<br>
> his is a es<br>
> his is a tes<br>
><br>
> Why wasnt the t removed ?</p>
<p>Try help(ste.strip)</p></div></blockquote><div><br></div>It clearly states "if chars is given and not None, remove characters in chars instead. <div><br></div><div>Does it mean remove only the first occurrence of char? That's the behavior I'm seeing. <br><blockquote type="cite"><div>
<p>-- <br>
Arnaud<br>
</p>
</div></blockquote></div></body></html>