Replace

Replace a substring using string substitution.

Description: To replace a substring with another string use the string substitution feature. The example shown here replaces all occurrences "teh" misspellings with "the" in the string variable str.
Script:
1.
2.
3.
4.
set str=teh cat in teh hat
echo.%str%
set str=%str:teh=the%
echo.%str%
Script Output:
 DOS Script Output
teh cat in teh hat
the cat in the hat