trying to replace 11/22/2016 to 11222016. for this I have tried the following and is working as expected.
set string=dd/mm/yyyy.
set find=/
set replace=
call set string=%%string:!find!=!replace!%%
echo %string%
output is ddmmyyyy
but when I tried this in the if condition this is not working as expected.
setlocal enabledelayedexpansion
set isDateFound=false
set string=dd/mm/yyyy.
if "%isDateFound%" == "false" (
echo %isDateFound%
set find=/
set replace=
call set string=%%string:!find!=!replace!%%
echo %string%
)
output dd/mm/yyyy
looks like the delayedexpressions is playing some role here. but I am not able to overcome this. How replace substring in side the if condition.