title: BAT :~ syntax for strings
body: <p>I see the ':~' symbols used pretty often in BAT files, I presume it gets a character at a position, but I couldn't find any confirmation of this, nor on how/when to use it (it appears it can get a range as well).</p>
  
  <p>Please if you could shed some light on this, thanks.</p>
  
  <pre><code>SET STRING=C:\MyDocuments\
  IF "%STRING:~-1%"=="\" SET STRING=%STRING:~0,-1%
  ECHO String: %STRING%
  </code></pre>
  
  <p>Also should %%A:~-1 work? or would I need to enclose it in ""?</p>