xiaolijian916 当前离线
上等兵
flyinnet9 当前离线
少尉
@echo off setlocal enabledelayedexpansion set /p str=输入字串: :loop if "!str:~%n%,1!" neq "" ( set /a n+=1 goto loop ) if %n% gtr 14 (echo.!str! ) else ( set "abc= " set str=!str!!abc! echo."!str:~0,15!" )复制代码
TOP
回家路上 当前离线
@echo off & setlocal enabledelayedexpansion ::If the length of the string is greater than 15, leave it unchanged ?? set /p str=Input: if "%str:~15%"=="" ( set "str=%str% " set str=!str:~,15! ) echo;====%str%==== pause复制代码
评分人数
codegay 当前离线
少校
"字符串".ljust(15,"空格")复制代码