中文翻译SwiftGG
print("Hello, World!") // Hello, World!
var name = "Roy"
print("我的名字:\(name)") // 我的名字:Roy
let country = "China"
print("我的国际:\(country)") // 我的国际:China
var age:Int
age = 18
print("我的年龄:\(age)")
var doubleValue:Double
doubleValue = 1.68
var floatValue:Float
floatValue = 3.14
var boolValue:Bool
boolValue = false
boolValue = true
print(boolValue) // true
var str:String
str = "1024"
print(str) // 1024
var character:Character
character = "$"
print(character) // $
var str:String? = "可选"
if str == nil {
print(str!) // 可选
}
let httpError = (404,"Not Found")
let (statusCode,statusMessage) = httpError
print(httpError.0)
print(httpError.1)
print(statusCode)
print(statusMessage)
let httpStatus = (statusCode:404,statusMessage:"Not Found")
print(httpStatus.statusMessage)
print(httpStatus.statusMessage)
网友评论