2、3楼方法挺好的,逐个判断。- @echo off
- for /f "useback delims=" %%a in ("%~f0") do set str=%%a
- setlocal enabledelayedexpansion
- set n=0
- :loop
- (echo=!str:~%n%,1!|findstr [0-9] && set str2=!str2!!str:~%n%,1!)1>nul 2>nul
- if "!str:~%n%,1!" neq "" (
- set /a n+=1
- goto :loop
- )
- echo !str! =^> !str2!
- endlocal
- pause
- exit
- a!@#d1$%;'":^2&*3b(c<,.>/?4_+5{}|%a%b6\
复制代码
|