Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // stride example
- let names = ["anotonio", "jeff", "ibraheem", "li"]
- for index in stride(from: 0, through: names.count - 1, by: 1) {
- print(names[index], terminator: " ")
- } // anotonio jeff ibraheem li
- for index in stride(from: names.count - 1, through: 0, by: -1) {
- print(names[index], terminator: " ")
- } // li ibraheem jeff anotonio
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement