Code: Select all
SETLOCAL ENABLEDELAYEDEXPANSION
call set "string=%%%~1%%"
set "charlist=%~2"
if not defined charlist set "charlist= "
for /f "tokens=* delims=%charlist%" %%a in ("%string%") do set "string=%%a"
( ENDLOCAL & REM RETURN VALUES
IF "%~1" NEQ "" SET "%~1=%string%"
)
EXIT /b
this is left trim batch from your website,
i named it as ltrim.bat
then i did ltrim.bat " dddd"
where is the output?
i dont know what call is. it seems like subroutine ltrim (in$, out%)
Code: Select all
in$=" aaa"
call ltrim(in$,out$)
print out$
how can i have this sub effect? with batch call?