声明函数:swap( inout a:Int , inout b:Int )
调用: swap(&x , &y)
调用: swap(&x , &y)
2016-03-31
//遍历
for i in -99...99
{
i*i
}
let str7 = "Hello,iMooc!"
for c in str7.characters
{
print(c)
}
for i in -99...99
{
i*i
}
let str7 = "Hello,iMooc!"
for c in str7.characters
{
print(c)
}
2016-03-30
新版 改成
let strRange = Range<String.Index>(str.startIndex..<str.endIndex)
let strRange = Range<String.Index>(str.startIndex..<str.endIndex)
2016-03-29
使用arc4random前必须先import AppKit,或者 UIKit, 或者 Foundation,或者Darwin.
2016-03-07
advance函数在swift2.0里面没办法使用,
//var replaceEndIndex = advanceBy(str.startIndex,7)要改为下面的
var replaceEndIndex=str.startIndex.advancedBy(7)
//var replaceEndIndex = advanceBy(str.startIndex,7)要改为下面的
var replaceEndIndex=str.startIndex.advancedBy(7)
2016-03-05