Text.StartsWith

構文

Text.StartsWith(text as nullable text, substring as text, optional comparer as nullable function) as nullable logical

バージョン情報

テキスト値 text がテキスト値 substring で始まる場合に true が返されます。

  • text: 検索する text
  • substring: substring から検索する substring である text
  • comparer: [省略可能] 比較の制御に使用する Comparer。 たとえば、Comparer.OrdinalIgnoreCase を使用して、大文字と小文字を区別しない検索を実行できます

comparerComparer であり、比較の制御に使用されます。 比較子を使用して、大文字と小文字を区別しない、またはカルチャおよびロケールに対応する比較を行うことができます。

数式言語では、次の組み込みの比較子を使用できます。

  • Comparer.Ordinal:序数に基づく正確な比較を実行するために使用されます
  • Comparer.OrdinalIgnoreCase:序数に基づき、大文字と小文字を区別しない正確な比較を実行するために使用されます
  • Comparer.FromCulture: カルチャ対応の比較を実行するために使います

例 1

テキスト "Hello, World" がテキスト "hello" で始まるかどうかを調べます。

使用方法

Text.StartsWith("Hello, World", "hello")

出力

false

例 2

テキスト "Hello, World" がテキスト "Hello" で始まるかどうかを調べます。

使用方法

Text.StartsWith("Hello, World", "Hello")

出力

true