empty spaces

How do I remove all spaces from string using shell scripts? I’ve var=”This is a test”, and I’d like to remove all spaces.

{ 11 comments }