Remove Spaces

Remove all spaces in a string via substitution.

Description: This script snippet can be used to remove all spaces from a string.
Script:
1.
2.
3.
4.
set str=      word       &rem
echo."%str%"
set str=%str: =%
echo."%str%"
Script Output:
 DOS Script Output
"      word       "
"word"