如果在另一个字符串中找到搜索的字符串,则计算结果为搜索字符串。
语法
$(findstring searchFor,input)
$(findstringi searchFor,input)
参数
searchFor
要搜索的字符串。
input
要在其中搜索的字符串。
返回值
如果在 input
中找到 searchFor
,则函数返回 searchFor
,否则返回 null。
备注
findstringi
是 findstring
的不区分大小写版本。
从 Visual Studio 2022 开始,此宏函数在 NMAKE 版本 14.30 或更高版本中可用。
示例
$(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