title: Sub string a variable with variable
body: <p>I have a .bat file that needed to substring a variable with another variable.
  The the substring will be inside a loop. I have two variable inside this loop.</p>
  
  <pre><code>echo %%i  
  
  echo %targetPath%
  </code></pre>
  
  <p>%%i is the full string. And I have to remove part of %%i if found a match string with %targetPath%</p>
  
  <p>My coding which is not working.</p>
  
  <pre><code>echo  %%i%:%targetPath%=%
  </code></pre>
  
  <p>My couldn't get it to work because I am confused with the %%name and %name%. This is my expected result. In php , we have a substring function that able to pass the fullstring into substring function and a keyword to be match. And this is what I trying to achieve</p>
  
  <pre><code>fullstr=abcdefghijk
  keyword=abcd
  
  result=efghijk
  </code></pre>
  
  <p>Current working code</p>
  
  <pre><code>setlocal EnableDelayedExpansion 
  
  set "targetPath=%~dp0in"
  
  for /r "%targetPath%" %%i in (.) do (
  
  set "str=%%i"
  echo  !str:%targetPath%=!
  
  )
  </code></pre>
  
  <p>Current output</p>
  
  <pre><code>echo  !str:C:\Users\vuser01\Desktop\Texture Packer\libgdxtools\in=!
  </code></pre>