swift -数组的遍历


import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
       // demo1()
       // demo2()
        
       // demo3()
        
        demo5()
    }
    
    
    // 按照下标遍历
    func demo1()  {
        //存放字符串
        let arr = ["张三","李四","小样"]
        
        for i in 0..

你可能感兴趣的:(swift -数组的遍历)