- @echo off
- setlocal enabledelayedexpansion
- set "str=0000f.h5h,h87h非fh好46hs 7df,asf8,hsf dh;58gh7.6sh4批:处理
- s86h7shh7gh8jiagn0"
- :next
- set a=!str:~0,1!
- set /a r=^a
- if !a! == 0 set/p=!0<nul&set/a c+=1
- if !r! neq 0 set/p=!a!<nul&set/a c+=1
- set str=!str:~1!
- if defined str goto next
- echo 共!c!个数字
- pause>nul
复制代码 这个也可以噢...
刚才发现,开了变量延迟后,在set /a的使用中,单一个!感叹号和脱字符^的作用是一样的。
[ 本帖最后由 心系自然 于 2008-4-27 19:34 编辑 ] |