Probably my most annoying coding blind spot…

Oct 20, 2009 11:02


Do you have that one thing that you have to constantly look up?

In python, to replace elements of a string, there are two operators.  One is a strictly linear search, the other uses regular expressions.  The regexp call to replace part of a string with another string is sub, and the string call to replace a part of a string with another string is ( Read more... )

python, personal, programming

Leave a comment

Comments 1

codeamazon October 20 2009, 18:14:02 UTC
I'd try to remember this this way:

"regex starts with r. The call that uses it should too! But they got it WRONG and it DOESN'T start with r."

Reply


Leave a comment

Up