OpenBI Docs Buy

Text.EndsWith

Whether a text ends 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.EndsWith(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 ending 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 ends with it; null when the text is null.

Examples

A PDF file name

Text.EndsWith("invoice.pdf", ".pdf")
true

Ignoring case

Text.EndsWith("INVOICE.PDF", ".pdf", Comparer.OrdinalIgnoreCase)
true

Text.StartsWith, Text.Contains, Text.End.

Last updated · OpenBI Studio 0.3.79