I have a string coming in the format:
div, v6571, 0, div, v8173, 300, p, v1832, 400
I want to split this string into multiple arrays, for the example above I would need 3 arrays, such that the format would be like this:
item[0] -> div
item[1] -> v6571
item[2] -> 0
I know that I can just do a .Split(',') on the string and put it into an array, but that’s one big array. For the string example above I would need 3 arrays with the structure provided above. Just getting a bit confused on the iteration over the string!
Thanks!
I’m not sure exactly what you’re looking for, but to turn the above into three separate arrays, I’d do something like:
Then you can iterate through your list of string arrays and do whatever.
This does assume that all of your string arrays will always be three strings long- if not, you’ll need to do a
foreachon that primeArray and marshal your arrays more manually.Here’s the exact code I used. Note that it doesn’t really change anything from my original non-compiled version:
When I check this in debug, it does have all three expected arrays.