声明

1
str2:String? = nil

如:

1
2
3
4
func test(str:String, str2:String? = nil){
}
test("哈哈");
test("哈哈", str2: "哈哈哈");