Stripping off extra spaces from a string
CJam, 7 bytes
q~S%S*p

Code Explanation
CJam has reserved all capital letters as inbuilt variables. So S has a value of a space here.
q~          e# Read the input (using q) and evaluate (~) to get the string
  S%        e# Split on running lengths (%) of space
    S*      e# Join (*) the splitted parts by single space
      p     e# Print the stringified form (p) of the string.

This removes the trailing and leading spaces as well
Try it online here