Upper Bound of a split

After a split command, how can I determine the upper bound (ubound in vb.net) of the string array created?
local z = split(streamtags,","); for (a = 0; a < ???; a ++){ //do something with z[a] }

There are two ways to do this:

  1. Use .len() to determine the length of the array, and iterate through it that way:

local z = split(streamtags, ","); local zlen = z.len(); for(local a = 0; a < zlen; a++) { // do something with z[a] }

  1. Iterate over the array using a foreach loop instead of a for loop:

local z = split(streamtags, ","); foreach(za in z) { // do something with za }

Take a look at the Squirrel and Squirrel Standard Library documentation for more (somewhat confusing) information about the language :slight_smile: