python,string,strip,split,join,sub http://stackoverflow.com/questions/1546226/the-shortest-way-to-remove-multiple-spaces-in-a-string-in-python The fox jumped over the log. The fox jumped over the log. " ".join(foo.split())re.sub(patten, replace, str)