How do I use/parse values from a StringUtils.splitByWholeSeparator

0 votes
asked Nov 2, 2017 by brandon-w-8204 (31,870 points)

1 Answer

0 votes

Here is some sample code on how to use the values from a StringUtils.splitByWholeSeparator

//Split the string into a array of values
var myValues = StringUtils.splitByWholeSeparator('1,2,3,4,5,6,7,8', ',');

//use a for loop to get all the values
for (var i = 0; i < myValues.length; i++) {
   //using a qie.debug to show the values. You can use the myValues[i] in any function.
   qie.debug('myValues[' + i + ']: ' + myValues[i]);

//You can use static numbers to get the values.
//The array is zero based so 0 is the first value

//You can use myValues[0] to get the first value
qie.debug(qie.debug('myValues[0]: ' + myValues[0]);
//You can use myValues[1] to get the second value
qie.debug(qie.debug('myValues[1]: ' + myValues[1]);

answered Nov 2, 2017 by brandon-w-8204 (31,870 points)