Skip to content

Instantly share code, notes, and snippets.

@eMdOS
Created May 17, 2020 20:37
Show Gist options
  • Save eMdOS/b1478b205513c5b2ac3454e960ceeafd to your computer and use it in GitHub Desktop.
Save eMdOS/b1478b205513c5b2ac3454e960ceeafd to your computer and use it in GitHub Desktop.
let elements: [String] = ["A", "B", "C", "D", "E", "F", "G", "H", "I"]
let chunk_1 = elements[...2].joined()
let chunk_2 = elements[3...5].joined()
let chunk_3 = elements[6...].joined()
concat(elements) == chunk_1 <> chunk_2 <> chunk_3
concat(elements) == concat([chunk_1, chunk_2, chunk_3])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment