I want to replace whitespace with underscore in a string to create nice URLs. So that for example:
\"This should be connected\" becomes \"This_should_be_conn
Python has a built in method on strings called replace which is used as so:
string.replace(old, new)
So you would use:
string.replace(" ", "_")
I had this problem a while ago and I wrote code to replace characters in a string. I have to start remembering to check the python documentation because they've got built in functions for everything.