Special Characters contained in Variable used in String:Replace command...
Posted: 06 Apr 2020 15:19
Hi all,
Got a tough one for you here. Tried asking this on many other forums but no real answer yet, just workarounds...
The problem with the above code is that it interprets the '=' symbol as part of the Find:Replace so we get the following output for !New!:
How can I change the syntax of the following command:
So the '=' contained in the variable %Modify% isn't interpreted as part of the above command?
Got a tough one for you here. Tried asking this on many other forums but no real answer yet, just workarounds...
Code: Select all
SET String=Some stuff. Desc=Some more stuff. Some final stuff.
SET Rep=CHANGED
SET Modify=Desc=Some more stuff.
SET "New=!String:%Modify%=%Rep%!"
ECHO !New!
Code: Select all
Some stuff.Some more stuff. =CHANGED=Some more stuff. Some final stuff.
Code: Select all
SET "New=!String:%Modify%=%Rep%!"