--- type: "fhirpath-function" title: "FHIRPath Function: endsWith" function: "endsWith" category: "String Manipulation" section: "5.6.5" source: "fhirpath/functions.json" --- # FHIRPath Function: endsWith Returns `true` when the input string ends with the given `suffix`. If `suffix` 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'.endsWith('efg') // true 'abcdefg'.endsWith('abc') // false ``` ## Summary - **Category**: String Manipulation - **Section**: `5.6.5` - **Return Type**: `Boolean` - **Empty Input Result**: `empty` - **Errors on Multiple Input**: `true` ## Description Returns `true` when the input string ends with the given `suffix`. ## Arguments - `suffix`: `String` - Suffix to check ## Type Mapping - `String-Boolean` ## Example ```fhirpath 'abcdefg'.endsWith('efg') // true 'abcdefg'.endsWith('abc') // false ```