Search found 2 matches
- 31 May 2013 20:36
- Forum: DOS Batch Forum
- Topic: Replace a substring with the contents of a variable
- Replies: 3
- Views: 2960
Re: Replace a substring with the contents of a variable
Thanks a lot. Both worked.
- 31 May 2013 18:00
- Forum: DOS Batch Forum
- Topic: Replace a substring with the contents of a variable
- Replies: 3
- Views: 2960
Replace a substring with the contents of a variable
Hi, See the following piece of code: set str=teh cat in teh hat echo.%str% set str=%str:teh=the% echo.%str% How can I use variables instead of teh and the in the line "set str=%str:teh=the%" ? I have tried this: set str=teh cat in teh hat echo.%str% var1=teh var2=the set str=%str:%var1%=%v...