Text.StartsWith
This function returns true if the specified text value begins with the specified substring value. text: The text value that will be searched. substring: The text value that will be searched for withi...
Text.StartsWith(text as nullable text, substring as text, optional comparer as nullable function) as nullable logical
This function returns true if the specified text value begins with the specified substring value.
text: The text value that will be searched.
substring: The text value that will be searched for within the text.
comparer: [Optional] A comparer that can be used to control the comparison. For example, Comparer.OrdinalIgnoreCase can be used for case-insensitive searches.
The comparer parameter allows for customization of the comparison process. Comparers can be used to enable case-insensitive comparisons or comparisons that are aware of cultural and regional differences.
The following built-in comparers are available in the formula language:
- Comparer.Ordinal: Performs an exact ordinal comparison.
- Comparer.OrdinalIgnoreCase: Performs an exact ordinal comparison that is case-insensitive.
- Comparer.FromCulture: Performs a comparison that is aware of cultural differences.
Verify if the string "Hello, World" begins with the characters "hello".
Syntax:
Power Query MText.StartsWith("Hello, World", "hello")
Result:
false
Verify if the string "Hello, World" begins with the characters "Hello".
Syntax:
Power Query MText.StartsWith("Hello, World", "Hello")
Result:
true