My code has a variable that contains the multiple value something like:
var GlobalOpportunityTypeID="8|9|10"
I want to split this value into different variables as per my requirement. How can I do this? Can anyone please let me know?
My code has a variable that contains the multiple value something like:
var GlobalOpportunityTypeID="8|9|10"
I want to split this value into different variables as per my requirement. How can I do this? Can anyone please let me know?
Use split() to split the values into an array, then unpack the array into variables.
var ids = GlobalOpportunityTypeID.split("|");
var id0 = ids[0],
id1 = ids[1],
id2 = ids[2];
If the number of variables is unknown or dynamic, then you might be better off dealing with the the array itself and not extract them to individual variables.