比较这两个就会发现上面的程序好象存在问题:
1.用135数值直接替换:
@echo off&setlocal EnableDelayedExpansion
@for /f "tokens=* delims=" %%i in ("135afw afwe33") do (
@set a=%%i
@echo !a:135=a!
)
pause
2.截取135数值进行替换:
@echo off&setlocal EnableDelayedExpansion
@for /f "tokens=* delims=" %%i in ("135afw afwe33") do (
@set a=%%i
@echo !a:!a:~0,3!=a!
)
pause
1.能够得到准确的答案,可2就不行!
waiting work out
1.用135数值直接替换:
@echo off&setlocal EnableDelayedExpansion
@for /f "tokens=* delims=" %%i in ("135afw afwe33") do (
@set a=%%i
@echo !a:135=a!
)
pause
2.截取135数值进行替换:
@echo off&setlocal EnableDelayedExpansion
@for /f "tokens=* delims=" %%i in ("135afw afwe33") do (
@set a=%%i
@echo !a:!a:~0,3!=a!
)
pause
1.能够得到准确的答案,可2就不行!
waiting work out
