I am looking to reverse an array of strings. For example the original array would look like this
var array = ["lizard", "Rhino", "Monkey"]
and the end result should be those words reversed in the same order like this remaining in one array:
["drazil", "onihR", "yeknoM"]
what I have now is this and I am reversing the strings correctly however it is making 3 separate arrays and all of the strings are separated by commas.
var array = ["lizard", "Rhino", "Monkey"]
for index in (array) {
println(reverse(index))
}
[d, r, a, z, i, l]
[o, n, i, h, R]
[y, e, k, n, o, M]
any help would be appreciated thank you.