[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
  • @ echo off
    set str=今日明月在
    echo %str:~2,2%%str:~0,2%%str:~-1%
    pause

TOP

@ echo offset str=今日明月在echo %str:~2,2%&echo %str:~0,2%&echo %str:~-1%pause

TOP

新人倍出啊

我也来一份 按自己习惯写
  1. @echo off
  2. set a=今日明月在
  3. set b=%a:~,2%
  4. set c=%a:~2,2%
  5. set d=%a:~-1%
  6. echo %b%
  7. echo %c%
  8. echo %d%
  9. echo.
  10. set/p=%c%%b%%d%
  11. pause
复制代码

TOP

继续交作业额~~~

题目进阶
  1. @echo off
  2. set a=今日明月在
  3. echo %a:~2,2%%a:~0,2%%a:~4,1%
  4. pause >nul
复制代码

TOP

新手交作业额~~~

  1. @echo off
  2. set a=今日明月在
  3. echo %a:~0,2%
  4. echo %a:~2,2%
  5. echo %a:~4,1%
  6. pause >nul
复制代码

TOP

  1. @echo off
  2. set a=今日明月在
  3. echo 原话为%a%,现通过该程序改为:
  4. set b=%a:~,2%
  5. set c=%a:~2,2%
  6. set d=%a:~4,1%
  7. echo %c%%b%%d%
  8. pause>nul
复制代码

TOP

  1. @echo off
  2. set str=今日明月在
  3. call,echo %%str:~0,2%%
  4. pause
  5. call,echo %%str:~2,2%%
  6. pause
  7. call,echo %%str:~-1%%
  8. pause
复制代码

TOP

  1. @echo off
  2. set str=今日明月在
  3. set aa=%str:~0,2%&set bb=%str:~2,2%&set cc=%str:~-1%
  4. ::分别输出"今日","明月","在"
  5. echo %aa%
  6. echo %bb%
  7. echo %cc%
  8. pause >nul
  9. ::输出"明月今日在"
  10. echo.%bb%%aa%%cc%
复制代码

TOP

1.
  1. @echo off
  2. set str=今日明月在
  3. set a=%str:~0,2%
  4. set b=%str:~2,2%
  5. set c=%str:~-1%
  6. echo %a%
  7. echo %b%
  8. echo %c%
  9. pause
复制代码
2.
  1. @echo off
  2. set str=今日明月在
  3. set a=%str:~0,2%
  4. set b=%str:~2,2%
  5. set c=%str:~-1%
  6. set /p=%b%%a%%c%<nul&echo.
  7. pause
复制代码
扬鞭策马自奋蹄!

TOP

  1. @echo off
  2. echo 今日明月在
  3. set a=今日明月在
  4. set b=%a:~0,2%
  5. set c=%a:~2,2%
  6. set d=%a:~4,1%
  7. echo %b%
  8. echo %c%
  9. echo %d%
  10. echo %c%%b%%d%
  11. pause>nul
复制代码

TOP

  1. @echo off
  2. set str=今日明月在
  3. set a=%str:~0,2%
  4. set b=%str:~2,2%
  5. set c=%str:~4,1%
  6. echo %a% %b% %c%
  7. echo %b%%a%%c%
  8. pause>nul
复制代码

TOP

练习一下子
  1. @echo off
  2. set var=今日明月在
  3. echo %var:~0,2%
  4. echo %var:~2,2%
  5. echo %var:~-1%
  6. echo.
  7. echo %var:~2,2%%var:~0,2%%var:~-1%
  8. pause
复制代码

TOP

  1. @echo off
  2. set var1=今日明月在
  3. set var2=%var1:~2,-1%
  4. set var3=%var1:~,2%
  5. set var4=%var1:~-1%
  6. echo %var2%%var3%%var4%
  7. pause
复制代码

TOP

新手学习中...

TOP

  1. @echo off
  2. set "qqname=今日明月在"
  3. set "str1=%qqname:~0,2%"
  4. echo %str1%
  5. set "str2=%qqname:~2,2%"
  6. echo %str2%
  7. set "str3=%qqname:~-1%"
  8. echo %str3%
  9. echo %str2%%str1%%str3%
  10. echo    按任意键退出!
  11. pause>nul
复制代码

TOP

返回列表