I have a string with delimiters that I use string.split to turn into an array. Sometimes I get an array with the proper length (say 3) but when I try to access [1] or [2] they're not there. If I'm in the debugger, I can see it says length 3, but when I expand it, there is only one item there.
For some additional context, I am using | (vertical bar) as my delimiter, which I now realize was maybe not the best choice as it's the pipe character. I've changed from a simple split to using a regex and not sure if the problem will go away. But before I do a lot more testing I thought I'd see if it was something obvious.
What I'm doing for the moment is using if (1 in fields) to check each index before I use it, but I hope there's a better way.