曲径通幽论坛

标题: findstring -- 查找字符串函数 [打印本页]

作者: beyes    时间: 2011-6-21 16:31
标题: findstring -- 查找字符串函数
findstring 函数可以用来查找字符串,它的格式是:
$(findstring FIND,IN)
findstring 从 IN 中查找 FIND 的字符串。如果 IN 中有 FIND,那么返回 FIND,否则返回空。其中,IN 中可以包含空格以及制表符(TAB)。此外,搜索需要严格的文本匹配。

测试代码:
[Plain Text] 纯文本查看 复制代码
all:
    @echo "$(findstring world, hello Makefile world)"

运行输出:
$ make
world





欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) Powered by Discuz! X3.2