Day6 function

 //                  **Day6

//                                          **Functiion

 

//func SayHello (value: String, value1:String)->String {

//

//    let str = value + "" + value1

//    

//    print("str (value)")

//    return str

//}

 

 

 

//SayHello("Hello",value1: "World")

//

//

//let string : String = SayHello("f",value1: "f")

 

//

//func SayHello(var value:String) {

//    value = "AA"

//    print(value)

//}

//

//SayHello("hello")

 

 

//func SayHello(values:Double...){

//    for item in values{

//        print("item : (item)")

//    }

//}

//

//SayHello(1.1,1.2,1.3)

 

// summary: the func of params is dictionary

 

//func SayHello(value:String,joinString value1:String) {

//

//    var str = value + value1

//    print("str = (str)")

//}

//

//SayHello("Hello,", joinString: "Swift")

 

//summary:  set a out func name

 

//func SayHello(inout value:String) {

//

//    value = "Hello Swift"

//}

//

//var str = "Hello"

//

//SayHello(&str)

//

//print("(str)")

 

 

// summary:  inout func  input string address   out change value

 

 

 

 

//func SayHello(value:String,nums value1:String) -> (String,String) {

//

//    return (value,value1)

//}

//

//

//var (A,B) = SayHello("Hello", nums: "World")

//

//print("A:(A) B:(B)")

 

// summary:  tuples

原文地址:https://www.cnblogs.com/tony0571/p/5362020.html