1.1:- @echo off
- set "str=i like the bathome,because here is the batch of the world."
- set "num=80"
- :lp
- set "str=%str%0"&set /a num-=1
- if "%str:~79,1%" neq "0" goto lp
- echo 字符个数为%num%个&pause>nul
复制代码
- @echo off
- echo i like the bathome,because here is the batch of the world.>1.txt&echo.>>1.txt
- for /f "delims=:" %%i in ('findstr /o .* 1.txt') do set "num=%%i"
- set /a num-=2&del /q 1.txt
- echo 字符个数为%num%个&pause>nul
复制代码
[ 本帖最后由 batman 于 2008-8-15 10:00 编辑 ] |