fn:starts-with

Check whether string 1 starts with string 2

Top of page

Related Syntax Constructs

The following construct(s) refer to this construct:


Syntax

fn:starts-with(string $string, string $startString) => boolean
fn:starts-with(string $string, string $startString, string $collation) => boolean

Description

This function checks whether or not the value of $string starts with the value of $startString. If the value of $startString is a string of length zero, the function returns true. If the value of $string is a string of length zero, but the value of $startString is not, the function returns false. If the value of either string is the empty sequence, the function returns the empty sequence.

Arguments

$string

string value

$startString

string value to be searched for in $string

$collation

optional valid collation string literal

Example

  • Select all patients that have some form of angina:

    for $a in input()/patient
    let $b := $a/submitted/diagnosis
    where starts-with($b, "Angina")
    return $a/name