【发布时间】:2011-02-15 21:05:33
【问题描述】:
我们可以使用以下命令替换批处理文件中的字符串
set str="jump over the chair"
set str=%str:chair=table%
这些行运行良好,并将字符串“jump over the chair”更改为“jump over the table”。现在我想用一些变量替换字符串中的单词“chair”,我不知道该怎么做。
set word=table
set str="jump over the chair"
??
有什么想法吗?
【问题讨论】:
-
how to replace string inside a bat file with command line parameter string 的可能副本,它有更多非正式的答案(虽然它与这里的答案有相同的解决方案)
-
现在谁是第一个并不重要,但最好将相同的问题联系起来并指出最不可破解的答案