Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
The cap symbol ^
is "special" to cmd. So it should not be used as a separator if you plan to solve the problem on batch files.
In general, your problem can be solved like this:
@echo off
set "str=hjh#jhjh#hkjh#khkjh##khkjh"
set "delim=#"
set "count=0"
:loop
call:finddelims
if defined str goto:loop
echo.%count%
goto:eof
:finddelims
for /f "tokens=1,* delims=%delim%" %%a in ("%str%") do (
echo.%%a
set /a "count+=1"
set "str=%%b"
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question