SHARE
TWEET

Untitled

a guest Sep 19th, 2019 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import UIKit
  2.  
  3. //var str = "Hello!"
  4. //
  5. //for index in 0..<100 {
  6. //    if index < 30 {
  7. //        let stringIndex = String(index)
  8. //        print(str + " - " + stringIndex)
  9. //    } else {
  10. //        print(str)
  11. //    }
  12. //}
  13.  
  14. var numbers = [Int]()
  15.  
  16. numbers.append(4)
  17. numbers.append(3)
  18. numbers.append(1)
  19. numbers.append(423)
  20. numbers.append(2342344)
  21. numbers.append(0)
  22. numbers.append(999)
  23.  
  24. let length = numbers.count
  25. var sum = 0
  26.  
  27. for index in 0..<length {
  28.     sum = sum + numbers[index]
  29. }
  30.  
  31. let removeNumber = numbers.remove(at: 3)
  32. numbers
  33.  
  34. numbers.append(2)
  35. numbers.remove(at: 1)
  36. let value = numbers[2]
  37.  
  38.  
  39. let names = ["Lukman", "Lukman", "Lukman", "Lukman"]
  40.  
  41. var search = "Lukman"
  42.  
  43.  
  44. for i in 0..<names.count {
  45.     let name = names[i]
  46.     if name == search {
  47.         print(i)
  48.     }
  49. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top