Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
17
Task/String-length/Batch-File/string-length.bat
Normal file
17
Task/String-length/Batch-File/string-length.bat
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
call :length %1 res
|
||||
echo length of %1 is %res%
|
||||
goto :eof
|
||||
|
||||
:length
|
||||
set str=%~1
|
||||
set cnt=0
|
||||
:loop
|
||||
if "%str%" equ "" (
|
||||
set %2=%cnt%
|
||||
goto :eof
|
||||
)
|
||||
set str=!str:~1!
|
||||
set /a cnt = cnt + 1
|
||||
goto loop
|
||||
Loading…
Add table
Add a link
Reference in a new issue