使用for和goto实现分割字符串
set tmpStr=a,b,c
:Loop
for /f "tokens=1,* delims=," %%a in ("%tmpStr%") do (
echo %%a
set tmpStr=%%b
)
if "%tmpStr%" EQU "" (
goto End
)
goto Loop
:End
输出结果
a
b
c
标签:分割,set,End,goto,批处理,%%,tmpStr%,字符串,tmpStr
来源: https://www.cnblogs.com/Kyle023/p/13098200.html