Agregar un array a otro array / Add an array of items to an existing array

/*Use the addition assignment operator (+=) to quickly add an array of items.*/ var cityArray: [String] = ["Portland","San Francisco","Cupertino","Seattle"] cityArray += ["Vancouver", "Los Angeles", "Eugene"] //The array now contains 7 items /*Alternately, if you have already created an array:*/ var cityArrayA: [String] = ["Portland","San Francisco","Cupertino","Seattle"] var cityArrayB: [String] = ["Vancouver", "Los Angeles", "Eugene"] cityArrayA += cityArrayB; //cityArrayA now contains 7 items.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.