如何在 Swift 中連接字符串? - How do I concatenate strings in Swift?

問題:

How to concatenate string in Swift?如何在 Swift 中連接字符串?

In Objective-C we do likeObjective-C我們確實喜歡

NSString *string = @"Swift";
NSString *resultStr = [string stringByAppendingString:@" is a new Programming Language"];

or或者

NSString *resultStr=[NSString stringWithFormat:@"%@ is a new Programming Language",string];

But I want to do this in Swift-language.但我想用 Swift 語言來做這件事。


解決方案:

參考一: https://en.stackoom.com/question/1cqNy
參考二: https://stackoom.com/question/1cqNy
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章