def _remove_whitespace(s, regex=_RE_WHITESPACE):
 return regex.sub(' ', s.strip())

def _remove_whitespace ( s , regex = _RE_WHITESPACE ) : return regex . sub ( ' ' , s . strip ( ) )
replace extra whitespace inside of a string with a single space .