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).
Please if you could shed some light on this, thanks.
SET STRING=C:\MyDocuments\
IF "%STRING:~-1%"=="\" SET STRING=%STRING:~0,-1%
ECHO String: %STRING%
Also should %%A:~-1 work? or would I need to enclose it in ""?