Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 1.34 KB

nmake-function-findstring.md

File metadata and controls

50 lines (34 loc) · 1.34 KB
description title ms.date helpviewer_keywords monikerRange
Learn more about: findstring, findstringi NMAKE functions
findstring, findstringi NMAKE functions
9/30/2021
findstring NMAKE function
findstringi NMAKE function
NMAKE function, findstring
NMAKE function, findstringi
>=msvc-170

findstring, findstringi NMAKE functions

Evaluates to the searched-for string if it's found within another string.

Syntax

$(findstring searchFor,input)
$(findstringi searchFor,input)

Parameters

searchFor
The string to search for.

input
The string to search in.

Return value

If searchFor is found within input, then the function returns searchFor, otherwise it returns null.

Remarks

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.

Example

$(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

See also

Macros and NMAKE
NMAKE functions by category