Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

Simple:

set var1=MY FOO BAR
set var2=%var1:*FOO=%
echo %var2%

Result:

 BAR

Note the Whitespace!

Remove Whitespace:

set var1=MY FOO BAR
set var2=%var1:*FOO=%
CALL :TRIM %var2% var2
ECHO %var2%
PAUSE
:TRIM
SET %2=%1

Result:

BAR
  • No labels