@echo off set "url=www.mzwu.com" echo 1.字符串截取 echo %url:~4,4% echo %url:~4,-4% echo %url:~-8,4% echo %url:~-8,-4% echo %url:~,4% echo %url:~,-4% echo %url:~4% echo %url:~-8% echo. echo 2.字符串替换,将mzwu替换为163 echo %url:mzwu=163% pause>nul