本帖最后由 went 于 2022-11-14 21:14 编辑
单字节字符补齐空格- @echo off & cd /d "%~dp0"
- call :show_str @123ab!cABC中$国人口¢
- pause&exit
-
- :show_str
- set "s1=%~1"
- set "s2="
- :loop
- if "%s1%"=="" goto :show
- set "c=%s1:~0,1%"
- if "%c%" lss "Z" if "%c%" gtr "¢" set "s2=%s2% "
- set "s2=%s2%%c%"
- set "s1=%s1:~1%"
- goto :loop
- :show
- echo.%s2%
复制代码
|