批处理删除两端

这用于删除字符串的第一个和最后一个字符

示例

@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

上一篇: 批处理字符串 下一篇: 批处理数组