This is used to extract characters from the end of a string.
@echo off set str = This message needs changed. echo %str% set str = %str:~-8% echo %str%
The key thing to note about the above program is, the right hand of the string is extracted by using the ~-‘number of characters to extract’ operator.
The above command produces the following output.
This message needs changed. changed.