I am sure this issue is something silly. But I am not sure what I am doing wrong. I want the variables, start and end to be used to set the mid string method I am using to set subStr. I have already read set /? with no success. Any help would be greatly appreciated.
echo off
rem // First I will set all my varialbles...
set pleaStr=this is just a test. Please help me figure this out. I appreciate your help
set start=21
set end=-23
set subStr=%pleaStr:~start,end%
rem // The mid string method works normally. See!!
set subStrEasy=%pleaStr:~21,-23%
rem // Return extracted URL:
echo %pleaStr%
echo %subStr%
echo %subStrEasy%
The code above, does not work if I substitute the Environment Variables(ENV) start and end for their digit counterparts, 21 and -23.
when I echo %subStr%
I get pleaStr:~start,end
where as echo %subStrEasy%
gives me Please help me figure this out.
Perhaps environment variable cannot be used in this manner?