type: fhirpath-functionfunction: startsWithcategory: String Manipulationsection: 5.6.4source: fhirpath/functions.json
FHIRPath Function: startsWith
Returns true when the input string starts with the given prefix.
If prefix is the empty string (''), the result is true.
If the input collection is empty, the result is empty.
If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment.
'abcdefg'.startsWith('abc') // true
'abcdefg'.startsWith('xyz') // false
Summary
- Category: String Manipulation
- Section:
5.6.4 - Return Type:
Boolean - Empty Input Result:
empty - Errors on Multiple Input:
true
Description
Returns true when the input string starts with the given prefix.
Arguments
Type Mapping
Example
'abcdefg'.startsWith('abc') // true
'abcdefg'.startsWith('xyz') // false