replace space with plus sign pyhon code example Example: space to underscore python mystring.replace(" ", "_")