| description | Learn more about: findstring, findstringi NMAKE functions | ||||
|---|---|---|---|---|---|
| title | findstring, findstringi NMAKE functions | ||||
| ms.date | 9/30/2021 | ||||
| helpviewer_keywords |
|
||||
| monikerRange | >=msvc-170 |
Evaluates to the searched-for string if it's found within another string.
$(findstring searchFor,input)
$(findstringi searchFor,input)searchFor
The string to search for.
input
The string to search in.
If searchFor is found within input, then the function returns searchFor, otherwise it returns null.
findstringi is the case-insensitive version of findstring.
This macro function is available starting in Visual Studio 2022, in NMAKE version 14.30 or later.
$(findstring Hello,Hello World!) # Evaluates to "Hello"
$(findstring Hey,Hello World!) # Evaluates to ""
$(findstring hello,Hello World!) # Evaluates to "" - findstring is case-sensitive
$(findstringi hello,Hello World!) # Evaluates to "hello" - findstringi is case-insensitive