XPath ends-with

Last modified: March 9, 2026

Overview

The ends-with() function checks whether a string attribute ends with a specific string as a sub-string.

Syntax

The syntax is as follows:

ends-with ( attribute, string_expression )

attribute

attribute specifies the attribute to test. It must be of the String type.

expression

string_expression specifies the value to test for being at the end of the attribute. It must be a string literal or a string parameter.

Example

This query returns all customers whose name ends with the sub-string sen:

        [ends-with(Name, 'sen')]
    
        //Sales.Customer[ends-with(Name, 'sen')]
    

Customers with the name "Jansen" or "Isaacsen" will be returned, for example, because both names end with "sen."