批处理中求变量的长度

来源:互联网 发布:双轨制直销系统 php 编辑:程序博客网 时间:2024/06/05 08:36

 

 

@echo off

set aa=Hello,world!

 

set /a n=0

if defined aa goto cou

 

goto NULL

 

:cou

call :count

echo %n%

goto end

 

:NULL

echo this string is null

goto end

 

:end

 

:count

set /a n+=1

set aa=%aa:~1%

if defined aa goto count

goto :eof

 

 

原创粉丝点击