description | title | ms.date | helpviewer_keywords | monikerRange | ||||
---|---|---|---|---|---|---|---|---|
Learn more about: subst, substi NMAKE functions |
subst, substi NMAKE functions |
9/30/2021 |
|
>=msvc-170 |
Evaluates to a string where all instances of one string have been replaced with another.
$(subst oldString,newString,input)
$(substi oldString,newString,input)
oldString
The string to replace.
newString
The string that replaces oldString
. This argument can be null.
input
The string to search.
Returns input
, but all instances of oldString
are replaced by newString
. If newString
is null, then all instances of oldString
are removed.
substi
is the case-insensitive version of subst
.
This macro function is available starting in Visual Studio 2022, in NMAKE version 14.30 or later.
$(subst Hello,Hey,Hello World!) # Evaluates to "Hey World!"
$(subst ed,ing,red ring mended) # Evaluates to "ring ring mending"
$(subst Hello ,,Hello World!) # Evaluates to "World!"
$(subst hello,Hey,Hello World!) # Evaluates to "Hello World!" - subst is case-sensitive, so no substitution performed
$(substi hello,Hey,Hello World!) # Evaluates to "Hey World!" - substi is case-insensitive