Hi, I'm Ask INFA!
What would you like to know?
ASK INFAPreview
Please to access Ask INFA.

Table of Contents

Search

  1. Preface
  2. Understanding Data Types and Field Properties
  3. Designing Processes
  4. Using and Displaying Data
  5. Designing Guides
  6. Designing Process Objects
  7. Designing Service Connectors
  8. Using App Connections
  9. System Services, Listeners and Connectors
  10. Designing Human Tasks

Design

Design

ends-with

ends-with

The ends-with function in XQuery is used to determine whether a string ends with a specified substring. It is a useful function for string manipulation and validation tasks.

Syntax

fn:ends-with(arg1, arg2, collation)
The following table describes the argument for this command:
Argument
Required/Optional
Description
arg1
Required
The main string to be checked. This is the string you want to analyze to see if it ends with
$arg2
. If it is an
empty-sequence()
, it is treated as an empty string.
arg2
Required
The substring to compare against the end of
$arg1
. If it is an
empty-sequence()
, it is treated as an empty string.
collation
A URI that specifies the collation to be used when comparing strings. Collations define locale-specific rules for comparing characters. The default collation is used if this parameter is omitted.

Return Value

  • Returns a boolean value indicating whether one string (
    $arg1
    ) ends with the characters of a second string (
    $arg2
    ).
  • Returns
    true
    if
    $arg1
    ends with
    $arg2
    .
  • Returns
    false
    if it does not.

Examples

The following table lists some sample values and return values:
SAMPLE FUNCTION
OUTPUT
fn:ends-with('query', 'y')
true
fn:ends-with('query', 'query')
true
fn:ends-with('query', '')
true
fn:ends-with('query ', 'y')
false
fn:ends-with('', 'y')
false
fn:ends-with("Hello, World!", "World!")
true
fn:ends-with("Hello, World!", "Hello")
false
fn:ends-with("Frère Jacques", "Jacques", "http://example.com/collation")
Assume
"http://example.com/collation"
supports specific comparison rules. The output would depend on whether the specified collation affects the treatment of accents or other features, possibly returning
true
.

0 COMMENTS

We’d like to hear from you!