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

substring-after

substring-after

The substring-after function in XQuery returns the part of a string that follows a specified substring. It is useful for extracting text that appears after a certain character or sequence in a given string.

Syntax

fn:substring-after(arg1, arg2, collation)
The following table describes the argument for this command:
Argument
Required/Optional
Description
arg1
Required
The input string from which the substring will be extracted. If the argument is an empty sequence (
()
), it is treated as an empty string.
arg2
Required
The substring to search for within
$arg1
. The function returns the portion of
$arg1
that follows the first occurrence of
$arg2
. If
$arg2
is an empty sequence, it is treated as an empty string.
collation
Required
The collation to use to compare strings

Return Value

  • Returns the substring of
    $arg1
    that appears immediately after
    $arg2
    .
  • If
    $arg2
    is not found within
    $arg1
    , the function returns an empty string.
  • If
    $arg2
    is an empty string, the entire
    $arg1
    is returned.

Examples

The following table lists some sample values and return values:
SAMPLE FUNCTION
OUTPUT
fn:substring-after('query', 'u')
ery
fn:substring-after('queryquery', 'ue')
ryquery
fn:substring-after('query', 'y')
zero-length string
fn:substring-after('query', 'x')
zero-length string
fn:substring-after('query', '')
query
fn:substring-after('', 'x')
zero-length string
fn:substring-after("Hello, World!", ", ")
"World!"

0 COMMENTS

We’d like to hear from you!