The split() function divides a string into smaller strings based on the given delimiter, returning a list of the resulting substrings.
split(str, delimiter)
| Argument | Type | Description |
|---|---|---|
str | String | The string to be divided |
delimiter | String | The delimiter |
Return type: String[]
UQLreturn split("apple, pumpkin, lemon tart", ", ")
Result: ["apple","pumpkin","lemon tart"]
Use a space to split the values of the genre property of the @movie node (such as "crime drama romance"), expand the list elements into individual data entries and deduplicate all entries.
UQLfind().nodes({@movie}) as mov with split(mov.genre, " ") as genreList uncollect genreList as genre return DISTINCT genre