@echo off
set var=av sdkjf dfj sdjf df abc efg
set var=%var: =.%
for %%i in (%var%) do set "var=%%~ni"
for %%i in (%var%) do set "var=%%~xi"
echo %var:.=%
pause
@echo off
set var=av sdkjf stdf asby dfj sdjf abc efg
set str="test"
setlocal EnableDelayedExpansion
for %%i in (%var%) do (
set last=!str!
set str=%%i
)
echo !last!嘿嘿
pause
foxjl很聪明啊!但有点不明白为什么call set b=%%i %%b%% 会使字符串倒序啊!
既然var的值不确定貌似下面用set /p 更合题意啊! 呵呵...拾君牙慧,请多指教
@echo off
set /p a=
for %%i in (%a%) do (call set b=%%i %%b%%)
for /f "tokens=2" %%i in ("%b%") do echo %%i
pause