Forum Discussion
tristaanogre
8 years agoEsteemed Contributor
So... what's not working? You don't clarify what errors or problems you running into. It would be helpful to understand where the problem is.
- tristaanogre8 years agoEsteemed Contributor
After I posted that, I tried it out... and yeah, it's not working... but that's because you have your logic incorrect.
aqString.Contains returns the position of the first instance of the desired substring. IF it doesn't find the string, it returns -1. So... change your logic to the followingfunction TextString(array) { if(aqString["Contains"](array,",") != -1) { aqString["ListSeparator"] = ',' } else if (aqString["Contains"](array,"|") != -1){ aqString["ListSeparator"] = '|' } /*Get the value of the first number*/ var FirstStringTobeginLooping = aqString["GetListItem"](array,0); }