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

starts-with

starts-with

The starts-with function in XQuery is used to determine whether a string begins with a specified substring. This function is particularly useful for string validation and prefix matching tasks.

Syntax

fn:starts-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 determine if it starts with
$arg2
. If it is an empty sequence (
()
), it is treated as an empty string.
arg2
Required
The substring to check for at the start of
$arg1
. If this argument is an empty sequence, it is treated as an empty string.
collation
Optional
A URI that specifies the collation to be used for string comparison. Collations are sets of rules for comparing characters in strings. If this parameter is omitted, the default collation is used.

Return Value

  • Returns a boolean indicating whether or not the value of
    $arg1
    starts with a sequence of collation units that provides a minimal match to the collation units of
    $arg2
    according to the collation that is used.
  • Returns
    true
    if the main string
    $arg1
    starts with the substring
    $arg2
    .
  • Returns
    false
    if it does not.

Examples

The following table lists some sample values and return values:
SAMPLE FUNCTION
OUTPUT
fn:starts-with('query', 'que')
true
fn:starts-with('query', 'query')
true
fn:starts-with('query', 'u')
false
fn:starts-with('query', '')
true
fn:starts-with('', 'query')
false
fn:starts-with('', '')
true
fn:starts-with('query', ())
true
fn:starts-with(' query', 'q')
false
fn:starts-with("Query", "que")
false

0 COMMENTS

We’d like to hear from you!