Find 函式

適用於: 畫布應用程式 桌面流程 模型導向應用程式 Power Platform CLI

如果它存在,請在另一個字串內尋找文字的字串。

描述

Find 函式會尋找另一個字串內的字串,並會區分大小寫。 若要忽略大小寫,首先使用引數上的 Lower 函式。

Find 會傳回找不到的字串之起始位置。 位置 1 是字串的第一個字元。 如果您在其中搜尋的字串不包含您要搜尋的字串,Find 會傳回 空白

語法

Find( FindString, WithinString [, StartingPosition ] )

  • FindString - 必要項目。 要尋找的字串。
  • WithinString - 必要項目。 要搜尋的字串。
  • StartingPosition - 非必要。 要開始搜尋的起始位置。 位置 1 是第一個字元。

範例

公式 Description Result
Find("World", "Hello World") 返回「World」的起始位置。 7
Find("World", "Hello World, Hello World", 10) 返回第 10 個字元之後第一次出現「World」的起始位置。 20
Find("Mars", "Hello World") 由於 FindString 不在 WithinString 中,因此傳回空白 Blank()