In my data set, the values of a string variable are composed of more than one word. Hence there is a space between two words. Since I want to use reshape wide hence I want to replace spaces between words with "-". For example, the variable subject has value "Theory of Computation". I want to make it "Theory-of-Computation".

It can be done using :
Code:
replace subject = "Theory-of-Computation" if subject == "Theory of Computation"
In my data set, there are lot many values and it will take me a lot of time to replace them one by one. Is there a way to use replace to get the desired result in one go?