批處理刪除兩端

這用於刪除字串的第一個和最後一個字元

示例

@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

上一篇: 批處理字串 下一篇: 批處理數組