批处理命令:带参数的字符串替换
@echo off
setlocal enabledelayedexpansion
set main_str=hello world
set src=hello
set dst=hi
echo %main_str%
set sub_str=!main_str:%src%=%dst%!
echo %sub_str%
@echo off
setlocal enabledelayedexpansion
set main_str=hello world
set src=hello
set dst=hi
echo %main_str%
set sub_str=!main_str:%src%=%dst%!
echo %sub_str%