title: windows batch script replace substring in a if condition
body: <p>trying to replace 11/22/2016 to 11222016. for this I have tried the following and is working as expected.</p>
  
  <pre><code>set string=dd/mm/yyyy.
  set find=/
  set replace=
  call set string=%%string:!find!=!replace!%%
  echo %string%
  </code></pre>
  
  <p>output is ddmmyyyy</p>
  
  <p>but when I tried this in the if condition this is not working as expected.</p>
  
  <pre><code>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%
      )
  </code></pre>
  
  <p>output dd/mm/yyyy</p>
  
  <p>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.</p>