Let say that we have an array of strings:
var cities: [String] = [“San Francisco”, “Denver”];
You can change one string elements of this array given an index.
In this case we change from “San Francisco” to Miami:
cities = “Miami”;
Now, let assume we wish to print the last letter of the first string in the array.
This first intent fails:
This will fail too:
let index = 4;
However, this will success:
© 2014, Alejandro G. Carlstein Ramos Mejia. All rights reserved.