返回列表 发帖
@echo off
color 1a
echo.=============================================================
echo.
echo.                 Eample of "For...in...do.."
echo.
echo.set str=I love,bbs;bathome.net
echo.A1:Print "I""love""bbs""bathome" and "cn" respectively.
echo.A2:Only to print "cn"
echo.
echo.=============================================================
set str=I love;bbs;bathome.net
echo.Here is the answer of A1 (Using Switch of "/f"):
for /f "tokens=1-5 delims=;. " %%a in ("%str%") do (echo %%a & echo %%b & echo %%c & echo %%d & echo %%e )
echo.===========================================
echo.Here is the answer of A2:
set str=I love;bbs;bathome.net
for /f "tokens=5 delims=;. " %%a in ("%str%") do (echo %%a )
echo.===========================================
set str=I love;bbs;bathome.net
echo.Here is the answer of A1 (No Using Switch of "/f"):
for %%a in (%str%) do (echo %%a)
set /p over= COPY
1

评分人数

    • cjiabing: Good.What is this?set /p over=技术 + 1

TOP

返回列表