這用於刪除字串的第一個和最後一個字元
範例
@echo off
set str=Batch scripts is easy. It is really easy
echo %str%
set str=%str:~1,-1%
echo %str%
關於上述程式中,~1,-1
用於刪除字串的第一個和最後一個字元。
以上命令產生以下輸出。
Batch scripts is easy. It is really easy
atch scripts is easy. It is really eas