Text.StartsWith

Last updated 5 months ago

Text.StartsWith

Indicates whether the text starts with a specified value.

function (optional text as nullable any, substring as text, optional comparer as nullable function) as nullable any

Description

Returns true if text value text starts with text value substring.

<div>
<code>comparer</code> is a <code>Comparer</code> which is used to control the comparison. Comparers can be used to provide case insensitive or culture and locale aware comparisons.
</div>
<div>
The following built in comparers are available in the formula language:
</div>
<ul>
<li><code>Comparer.Ordinal</code>: Used to perform an exact ordinal comparison</li>
<li><code>Comparer.OrdinalIgnoreCase</code>: Used to perform an exact ordinal case-insensitive comparison</li>
<li> <code>Comparer.FromCulture</code>: Used to perform a culture aware comparison</li>

Category

Text.Membership

Examples

Check if the text "Hello, World" starts with the text "hello".

Text.StartsWith("Hello, World", "hello")

false

Check if the text "Hello, World" starts with the text "Hello".

Text.StartsWith("Hello, World", "Hello")

true