--- type: "fhirpath-function" title: "FHIRPath Function: length" function: "length" category: "String Manipulation" section: "5.6.13" source: "fhirpath/functions.json" --- # FHIRPath Function: length Returns the number of characters in the input string. 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. ## Summary - **Category**: String Manipulation - **Section**: `5.6.13` - **Return Type**: `Integer` - **Empty Input Result**: `empty` - **Errors on Multiple Input**: `true` ## Description Returns the length of the input string. Returns the number of characters in the string. ## Arguments - none ## Type Mapping - `String-Integer` ## Example ```fhirpath 'abcdefg'.length() // 7 ''.length() // 0 ```