OpenBI Docs Buy

Text.StartsWith

Whether a text begins with a given piece of text.

Group: Text and characters. Power Query M has it too: a query that uses it is written as in Power BI.

Syntax

Text.StartsWith(text as nullable text, substring as text, optional comparer as nullable function) as nullable logical
ParameterTypeDescription
textnullable textThe text to check; null gives null.
substringtextThe beginning to look for.
comparernullable function
optional
How to compare: Comparer.Ordinal (the default, case counts) or Comparer.OrdinalIgnoreCase.

Returns

nullable logical. true when the text starts with it; null when the text is null.

Examples

A Norwegian postcode

Text.StartsWith("NO-0150", "NO")
true

Ignoring case

Text.StartsWith("no-0150", "NO", Comparer.OrdinalIgnoreCase)
true

Text.EndsWith, Text.Contains, Text.Start.

Last updated · OpenBI Studio 0.3.79