有谁知道如何从 DOS 批处理脚本中的字符串中去除引号字符?使用字符串替换功能可以轻松去除字符,但去除引号(或感叹号)似乎有点困难。这是我试图开始工作的测试脚本:
@echo off
SETLOCAL ENABLEDELAYEDEXPANSION
echo.
set "NAME=Izomorphius"
call :append NAME " is my dear friend."
echo Message: %NAME%
echo.
goto :end
:: Functions
:append @varname @value
IF NOT "%3"=="" (
echo Too many arguments to function.
)
set vara=%1
set stra=%2
set stra=%stra:""=%
set "%1=!%1! %2"
exit /B 0
:end
pause
这是此脚本的输出:
Message: Izomorphius " is my dear friend."