I have multidimensional array and I'm trying to create a string that accesses the values of each subarray based on position. For example:
appointments = [["get lunch", "3pm", "fancy clothes"], ["walk the dog", "1pm", "sweat pants"]]
I want to use this information to create a single string by iterating over each subarray and outputting the values in the following format:
"You have an appointment to #{subarray[0]} at #{subarray[1]}.
Make sure you wear #{subarray[2]}."
Therefore, the final output would be something like:
"You have an appointment to get lunch at 3pm.
Make sure you wear fancy clothes.
You have an appointment to walk the dog at 1pm.
Make sure you wear sweat pants."
Any suggestions on how can I accomplish this?