how to remove whitespace in middle of string python code example Example: replacing spaces in a string python mystring.replace(" ", "_")