Swift 笔记(三)

前端之家收集整理的这篇文章主要介绍了Swift 笔记(三)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我的主力博客半亩方塘

Strings


It's possible to add characters to a string. However,Swift's strictness with types means you have to be explicit when doing so,just as you have to be when you work with numbers if one is anIntand the other is aDouble.

To add a character to a string,you do this:

let exclamationMark: Character = "!"
var message = "Hello" + " my name is Matt"
message += String(exclamationMark)  
原文链接:https://www.f2er.com/swift/324525.html

猜你在找的Swift相关文章