If I have an array like this:
array = ["A", "P", "P", "L", "E"]
And I would like to use the elements of the array to build a sentence. Like for example "I would like to have an APPLE"
I think I saw something similar being done using the yield method. But not sure how to use that in this scenario.
If I just parse the array to string like this:
the_word = array.to_s
Its still is displayed as a array of strings. ["A", "P", "P", "L", "E"]
So my question is how do I get the elements of the array and formats the elements into a string, without iterating the whole sentence multiple times?