XPath starts-with
Last modified: January 19, 2026
Overview
The starts-with() function tests whether a string attribute starts with a specific string as a sub-string.
String comparisons in XPath constraints are generally case-insensitive, but this can depend on the collation setting for some databases. See Case-Sensitive Database Behavior for more information.
Example
This query returns all the customers from which the name starts with the string "Jans":
[starts-with(Name, 'Jans')]
//Sales.Customer[starts-with(Name, 'Jans')]
Customers with the name "Jansen" will be returned, for example, because the name starts with "Jans."