Text.Contains Function in Power Query
The Text.Contains function returns true if a given substring value is found within the given text value; otherwise, false.
Note: If we are not specified any comparer function, then by default the comparison is case sensitive.
Syntax
Text.Contains(text as nullable text, substring as text, optional comparer as nullable function) as nullable logical
Example:
Power Query M
= Text.Contains("Ashish Goel", "hish")
The output of the above code is true.
Example: The comparison is case sensitive.
Power Query M
= Text.Contains("Ashish Goel", "Hish")
The output of the above code is false.
Example: By using the comparer function Comparer.OrdinalIgnoreCase. The comparison is case sensitive.
Power Query M
= Text.Contains("Ashish Goel", "Hish", Comparer.OrdinalIgnoreCase)
The output of the above code is true.