- @echo Off & setlocal EnableDelayedExpansion
- set "var=tEST" & set "str=!var!"
-
- set "Lower=a b c d e f g h i j k l m n o p q r s t u v w x y z"
- set "Upper=A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"
- For %%a in (%Lower%) do set "var=!var:%%a=%%a!"
- For /L %%a in (0 2 51) do (set "_!Lower:~%%a,1!=!Upper:~%%a,1!")
-
- :Loop
- If defined str (
- set "AlphaL=%str:~,1%" & set "AlphaU=%var:~,1%" & set "Letter=!AlphaU!
- If "!AlphaL!" equ "!AlphaU!" If defined _!AlphaL! (set "Letter=!_%str:~,1%!")
- set "str=%str:~1%" & set "var=%var:~1%"
- <nul set /p=!Letter!& goto :Loop
- )
- Echo\ & Pause>nul
复制代码
|