--- type: "fhirpath-function" title: "FHIRPath Function: split" function: "split" category: "Additional String Functions" section: "5.7.6" source: "fhirpath/functions.json" --- # FHIRPath Function: split {:.stu} The split function splits a singleton input string into a list of strings, using the given separator. {:.stu} If the input is empty, the result is empty. {:.stu} If the input string does not contain any appearances of the separator, the result is the input string. {:.stu} The following example illustrates the behavior of the `.split` operator: {:.stu} ``` fhirpath ('A,B,C').split(',') // { 'A', 'B', 'C' } ('ABC').split(',') // { 'ABC' } 'A,,C'.split(',') // { 'A', '', 'C' } ``` {:.stu} ## Summary - **Category**: Additional String Functions - **Section**: `5.7.6` - **Return Type**: `collection` - **Empty Input Result**: `empty` - **Errors on Multiple Input**: `true` ## Description Splits the input string using `separator` as the split point and returns a collection with one string for each portion of the input. ## Arguments - `separator`: `String` - String to use as separator ## Type Mapping - `String-String` ## Example ```fhirpath 'a,b,c,d,e'.split(',') // { 'a', 'b', 'c', 'd', 'e' } 'a b c'.split(' ') // { 'a', 'b', 'c' } ```