- @echo off
- :input
- cls
- set /p str=请输入一串字符(纯数字):
- echo.%str%|findstr "^[0-9]*$">nul|| (cls& echo 所输入的不是纯数字,请重新输入& pause& goto input)
- for /f "delims=0 tokens=1*" %%i in ("10%str%") do set str2=%%j
- cls
- echo 你输入的字符串为:%str%
- echo 去前面所有的零为:%str2%
- pause
- goto input
复制代码
|