用变量截取字符变量的问题- @echo on
- setlocal enabledelayedexpansion
- set xx=abcdefghijklmnopqrstuvwxyz
- set dx=ABCDEFGHIJKLMNOPQRSTUVWXYZ
- set /p name=
-
- set name2=
- for %%n in ('%name%') do (
-
-
- for /l %%i in (0 1 25) do (
- set num=%%i
- if %%n==!xx:~%%i,1! (
-
- set name1=!dx:~%num%,1!
- goto :loop
- )
-
- )
- :loop
- set name2=%name2%!name1!
- )
- set name=!num2!
- echo %name%
- pause
复制代码 怎么样才能在条件语句内部调用num或%%i,现在运行后%num%是空值,换成%%i也是空值 |