One simplest option I can think of, given I saw you are handling string type
Above is with the assumption that the number of items in your array is defined or always same.
But there could be numerous other ways to do, purely based on your business requirement.