
求解釋批處理中%與混用的時候變量的替換順序
得到結果nclick="copycode($('code0'));">復制代碼
- @echo off
- set str=ab%%cd!n!
- setlocal enabledelayedexpansion
- set n=2
- echo %str% %str:~!n!%
- call echo %%str%% %%str:~!n!%%
- pause>nul
nclick="copycode($('code1'));">復制代碼
- ab%cd2 str:~2
- ab%cd!n! %cd!n!

