remove white spaces from the string start python code example Example: replacing spaces in a string python mystring.replace(" ", "_")