Advertisement
Guest User

Untitled

a guest
Jul 20th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. // stride example
  2. let names = ["anotonio", "jeff", "ibraheem", "li"]
  3.  
  4. for index in stride(from: 0, through: names.count - 1, by: 1) {
  5. print(names[index], terminator: " ")
  6. } // anotonio jeff ibraheem li
  7.  
  8. for index in stride(from: names.count - 1, through: 0, by: -1) {
  9. print(names[index], terminator: " ")
  10. } // li ibraheem jeff anotonio
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement