Hi,
I’m very puzzled… I can easily make an array out of a string using SPLIT. But how do I reverse that?
In JavaScript:
let a = mystring.split(" ")
let s = a.join(" ")
Usecase is converting strings containing several words to TitleCase, for example “FIRSTNAME LASTNAME” to “Firstname Lastname”, which is basically quite simple:
ARRAY INITCAP(e) FOR e IN SPLIT(wtuname, " ") END
but that returns an array, not a string. So far I did a workaround:
REPLACE(REPLACE(REPLACE(REPLACE(ENCODE_JSON(ARRAY INITCAP(e) FOR e IN SPLIT(wtuname, " ") END), "[\"", ""),"\"]", ""), "\"", ""), ",", " ")
But that is very, very ugly and feels just wrong.