One way would be to use the value of the index required to access the element in the array.
rank[2] = "3" would give "3" the value 2