I am storing some data in a string as a comma separated list and using the Split function to create an array in Wappler when the data is read.
When the string’s value is an empty string, the split function is creating an array with one empty element. In this condition I would expect it to create an empty array.
Question 1
Is this an unfortunate feature of Split, or a bug?
Question 2
If I cannot change this behaviour, then I need to detect if the string value is “” or of length 0 and decide whether to reset the contents of my array or fill it with the split values… and I’m not very clear on how to do that!
Here is my array assignment at the moment:
contact.data.contact.contact_tags.split(",")
So I’m not quite sure how to do this assignment:
contact.data.contact.contact_tags=="" ? ASSIGN_EMPTY_ARRAY : contact.data.contact.contact_tags.split(",")
Thoughts appreciated!
Antony.