这用于从字符串末尾提取字符。
@echo off set str=This message needs changed. echo %str% set str=%str:~-8% echo %str%
关于上述程序,需要注意的关键是,使用〜-"要提取的字符数"运算符来提取字符串的右边。
链接:https://www.learnfk.comhttps://www.learnfk.com/batch-script/batch-script-right-string.html
来源:LearnFk无涯教程网
上面的命令产生以下输出。
This message needs changed. changed.
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)