--- type: "fhirpath-function" title: "FHIRPath Function: startsWith" function: "startsWith" category: "String Manipulation" section: "5.6.4" source: "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. ``` fhirpath '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 - `prefix`: `String` - Prefix to check ## Type Mapping - `String-Boolean` ## Example ```fhirpath 'abcdefg'.startsWith('abc') // true 'abcdefg'.startsWith('xyz') // false ```