Code: Select all
CALL :%1 %*
EXIT /B
:LTRIM
(@ECHO OFF
SetLocal EnableExtensions EnableDelayedExpansion
SET "STRING=!%~2%!
FOR /F "TOKENS=* DELIMS= " %%A IN ("!STRING!") DO SET "STRING=%%A"
)
(Endlocal
IF "%~2" NEQ "" SET "%~2=%STRING%"
)
EXIT /B
ZZZ=
Code: Select all
@ECHO OFF
SETLOCAL
ECHO 1234567890
SET IN= ! AAA
CALL "LIB-STRING1.BAT" LTRIM IN
ECHO %IN%
PAUSE
how can i fix ZZZ= for a string with "!"?