[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
1.1:
  1. @echo off
  2. set "str=i like the bathome,because here is the batch of the world."
  3. set "num=80"
  4. :lp
  5. set "str=%str%0"&set /a num-=1
  6. if "%str:~79,1%" neq "0" goto lp
  7. echo 字符个数为%num%个&pause>nul
复制代码
  1. @echo off
  2. echo i like the bathome,because here is the batch of the world.>1.txt&echo.>>1.txt
  3. for /f "delims=:" %%i in ('findstr /o .* 1.txt') do set "num=%%i"
  4. set /a num-=2&del /q 1.txt
  5. echo 字符个数为%num%个&pause>nul
复制代码

[ 本帖最后由 batman 于 2008-8-15 10:00 编辑 ]
***共同提高***

TOP

1.2:
  1. @echo off
  2. set "str=%%a%%!ver!&^^^ ^*~                     are you o                 k ?" : \  / ` `  verfdxcweippo opj x ds gw !%%"
  3. setlocal enabledelayedexpansion
  4. set "num=255"
  5. :lp
  6. set "str=!str! "&set /a num-=1
  7. if "!str:~254,1!" neq " " goto lp
  8. echo 字符个数为%num%个&pause>nul
  9. pause>nul
复制代码

[ 本帖最后由 batman 于 2008-8-15 10:09 编辑 ]
1

评分人数

***共同提高***

TOP

返回列表