In my code, I am looping through each character in a string. I need to test if the character is a space.
This is my code:
if %str% == " " (
::echo Empty
echo | set /p=%space%
goto loopEnd
)
I have also tried:
if [%str%] == [" "] (
::echo Empty
echo | set /p=%space%
goto loopEnd
)
Both give the error
( was unexpected at this time.
Or
] was unexpected at this time.
I don't get errors testing for letters or numbers. What am I doing wrong?
Thanks,
Zach