Text.Contains
Syntax
Text.Contains(text as nullable text, substring as text, optional comparer as nullable function) as nullable logical
About
Detects whether text
contains the value substring
. Returns true if the value is found. This function doesn't support wildcards or regular expressions.
The optional argument comparer
can be used to specify case-insensitive or culture and locale-aware comparisons. The following built-in comparers are available in the formula language:
- Comparer.Ordinal: Used to perform a case-sensitive ordinal comparison
- Comparer.OrdinalIgnoreCase: Used to perform a case-insensitive ordinal comparison
- Comparer.FromCulture: Used to perform a culture-aware comparison
Example 1
Find if the text "Hello World" contains "Hello".
Usage
Text.Contains("Hello World", "Hello")
Output
true
Example 2
Find if the text "Hello World" contains "hello".
Usage
Text.Contains("Hello World", "hello")
Output
false
Example 3
Find if the text "Hello World" contains "hello", using a case-insensitive comparer.
Usage
Text.Contains("Hello World", "hello", Comparer.OrdinalIgnoreCase)
Output
true
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for