--- type: "fhirpath-function" title: "FHIRPath Function: trim" function: "trim" category: "Additional String Functions" section: "5.7.5" source: "fhirpath/functions.json" --- # FHIRPath Function: trim {: .stu } The trim function trims whitespace characters from the beginning and ending of the input string, with whitespace characters as defined in the [Whitespace](#whitespace) lexical category. {:.stu} If the input is empty, the result is empty. {:.stu} ## Summary - **Category**: Additional String Functions - **Section**: `5.7.5` - **Return Type**: `String` - **Empty Input Result**: `empty` - **Errors on Multiple Input**: `true` ## Description Returns the input string with leading and trailing whitespace removed. ## Arguments - none ## Type Mapping - `String-String` ## Example ```fhirpath ' abc '.trim() // 'abc' '\tabc\n'.trim() // 'abc' ```