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