Remove

Remove a substring using string substitution.

Description: The string substitution feature can also be used to remove a substring from another string. The example shown here removes all occurrences of "the " from the string variable str.
Script:
1.
2.
3.
4.
set str=the cat in the hat
echo.%str%
set str=%str:the =%
echo.%str%
Script Output:
 DOS Script Output
the cat in the hat
cat in hat