Get array element at index

 Problem

I have an array and want to a get a specific element, by index.



 Recipe


// Initialize the Array
var arr = ["one", "two", "three"]

// Get element at index: 1
print(arr[1])
				

Heard the news?

The Swift Cookbook for Swift 3 is at last here! For iBooks, Kindle and Paperback.
Hurry up - and Check it out! ;-)

 

 Playground