Skip to main content



StartsWith Function

Determines if a text string or expression starts with another text string or expression.

Syntax 1

StartsWith(string, searchValue)

Determines if a text string or expression starts with another text string or expression.

Arguments

string String - A string.

searchValue String - A string.

Syntax 2

StartsWith(string, searchValue, caseSensitive)

Determines if a text string or expression starts with another text string or expression.

Arguments

string String - A string.

searchValue String - A string.

caseSensitive Boolean - True for a case-sensitive search. If omitted, false (case-insensitive search) is used.

Remarks

Example:

StartsWith("Discount applied to order", "applied"); // returns false

Example:

StartsWith("Discount applied to order", "Discount"); // returns true

Example:

StartsWith("Discount applied to order", "discount"); // returns true

Example:

StartsWith("Discount applied to order", "discount", true); // returns false