在DOS批处理中要将某一行中的部分文字替换掉, 今天找到办法了.
set str=hello, this is a test, replace some characters using dos command
rem 将小写开头的hello替换为大写开头的Hello
set str2=%str:hello=Hello%
echo %str%
echo %str2%
得到的结果为:
hello, this is a test, replace some characters using dos command
Hello, this is a test, replace some characters using dos command