--- type: "fhirpath-function" title: "FHIRPath Function: join" function: "join" category: "Additional String Functions" section: "5.7.7" source: "fhirpath/functions.json" --- # FHIRPath Function: join {:.stu} The join function takes a collection of strings and _joins_ them into a single string, optionally using the given separator. {:.stu} If the input is empty, the result is empty. {:.stu} If no separator is specified, the strings are directly concatenated. {:.stu} The following example illustrates the behavior of the `.join` operator: {:.stu} ``` fhirpath ('A' | 'B' | 'C').join() // 'ABC' ('A' | 'B' | 'C').join(',') // 'A,B,C' ``` {:.stu} ## Summary - **Category**: Additional String Functions - **Section**: `5.7.7` - **Return Type**: `String` - **Empty Input Result**: `empty` - **Errors on Multiple Input**: `false` ## Description Combines the elements in the input collection into a single string, separated by `separator`. If no separator is specified, the elements are concatenated directly. ## Arguments - `separator` (optional): `String` - Optional separator to use between elements ## Type Mapping - `String-String` ## Example ```fhirpath {'a', 'b', 'c'}.join(',') // 'a,b,c' {'a', 'b', 'c'}.join() // 'abc' ```