Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 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