Use the split , len and empty functions:
let list=split(string, ',') let list_length=len(list) " If all you want is to check whether list is empty: if empty(list) throw "You must provide at least one value" endif
Please note that if you want to get a list of numbers from a string, you will have to use a map to convert list items to numbers:
let list=map(split(string, ','), '+v:val')
In most cases, you can expect strings to be converted to numbers, but sometimes such a conversion fails.
source share