- @echo off&setlocal enabledelayedexpansion
- set "a=bathome"
- ::以下for循环实现的是set "b=a"&set "c=b"&set "d=c"&set "e=d"
- for %%a in (ba cb dc ed) do set "str=%%a"&set "!str:~,1!=!str:~1!"
- call call call call set /p=e=%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%e%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- pause
复制代码 发现这样还简洁点,请问各位前辈,还能再简洁不了呢。。。- @echo off&setlocal enabledelayedexpansion
- set "a=bathome"
- ::以下for循环实现的是set "b=a"&set "c=b"&set "d=c"&set "e=d"
- for %%a in (ba cb dc ed) do set "str=%%a"&set "!str:~,1!=!str:~1!"
- call call call set /p=e=%%%%%%%%%%%%%%!%e%!%%%%%%%%%%%%%%
- pause
复制代码
[ 本帖最后由 fish 于 2010-8-1 23:51 编辑 ] |