Find 函数

适用于: 画布应用 Copilot Studio Desktop 流 模型驱动应用 Power Platform CLI Dataverse 函数 Power Pages

在其他字符串中查找文本字符串(如果存在)。

描述

Find 函数查找另一个字符串中的字符串,区分大小写。 若要忽略大小写,需首先对参数使用 Lower 函数。

Find 返回找到的字符串的起始位置。 位置 1 是字符串的第一个字符。 Find 如果正在搜索的字符串不包含要搜索的字符串,则返回 空白

语法

FindFindString,WithinString [, StartingPosition ] )

  • FindString - 必需。 要查找的字符串。
  • WithinString - 必需。 要在其中搜索的字符串。
  • StartingPosition - 可选。 开始搜索的起始位置。 位置 1 是第一个字符。

示例

公式 描述 结果
Find(“World”, “Hello World”) 返回 "World" 的起始位置。 7
Find(“World”、“Hello World, Hello World”, 10) 第 10 个字符之后返回第一次出现 "World" 的起始位置。 20
Find(“火星”, “Hello World”) 由于 FindString 不在 WithinString 中,因此返回空白 Blank()