这用于通过替换删除字符串中的所有空格。
@echo off set str=This string has a lot of spaces echo %str% set str=%str:=% echo %str%
关于上述程序,需要注意的关键是::=运算符用于删除字符串中的所有空格。
上面的命令产生以下输出。
链接:https://www.learnfk.comhttps://www.learnfk.com/batch-script/batch-script-remove-all-spaces.html
来源:LearnFk无涯教程网
This string has a lot of spaces Thisstringhasalotofspaces
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)