How do I concatenate strings in Swift?

前端 未结 20 1846
梦毁少年i
梦毁少年i 2020-11-28 03:04

How to concatenate string in Swift?

In Objective-C we do like

NSString *string = @\"Swift\";
NSString *resultStr = [string stringByAppen         


        
20条回答
  •  醉话见心
    2020-11-28 03:41

    To print the combined string using

    Println("\(string1)\(string2)")
    

    or String3 stores the output of combination of 2 strings

    let strin3 = "\(string1)\(string2)"
    

提交回复
热议问题