📅  最后修改于: 2022-03-11 15:02:54.033000             🧑  作者: Mango
@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
SET /p NAME=- NAME ?
ECHO "%NAME%"
CALL :TRIM NAME
ECHO "%NAME%"
GOTO :EOF
:TRIM
SetLocal EnableDelayedExpansion
Call :TRIMSUB %%%1%%
EndLocal & set %1=%tempvar%
GOTO :EOF
:TRIMSUB
set tempvar=%*
GOTO :EOF