(Batch) Strlen em Batch
Encontrei uma função para strlen em batch na internet. Muito interessante e bem eficiente.
@echo offcall :strlen "teste"echo A palavra "TESTE" tem exatamente %ERRORLEVEL% caracteresPAUSE:strlensetlocal ENABLEEXTENSIONS ENABLEDELAYEDEXPANSIONset __LEN=0set __LEN_S=%~1:strlen_loopif "!__LEN_S!"=="" exit /B %__LEN%for %%Q IN (32 16 8 4 2) DO if NOT "!__LEN_S:~%%Q!"=="" set /A __LEN=!__LEN!+%%Q&set __LEN_S=!__LEN_S:~%%Q!&goto :strlen_loopset /A __LEN=!__LEN!+1&set __LEN_S=!__LEN_S:~1!&goto :strlen_loop