Hi Everyone,
Can anyone please help me how to split values, for example if input is 102-105; 109-111 then output should be 102, 103, 104, 105, 109, 110, 111.
Discussion posts and replies are publicly visible
Hi, You can have the symbols as an array and split like below
a!localVariables( local!data: {"102-105"; "109-111"}, local!symbolsToSplit: { "-", ";" }, local!splittedData:a!forEach( items: local!data, expression: split(fv!item, local!symbolsToSplit), ), a!flatten(local!splittedData) )
In what way this fulfills the requirement of the author? And why you are trying to split on ";" , if it is already a list of string.
Have a clear look at the use case first.
Above approach we can split the data in an extensible manner according to the available symbols but the resultant data have to be filtered based on the requirements in this case I haven't filtered the data just flattened. The above approach is mentioned considering the ";" can be either in string or array. But As I mentioned according to the requirement author can remove the data which are not relevant.