我正在尝试一些我在natashatherobot.com上找到的简单代码.varstr="Hello,playground"letrangeOfHello=Range(start:str.startIndex,end:advance(str.startIndex,5))lethelloStr=str.substringWithRange(rangeOfHello)returnhelloStr当我在Playgrounds中尝试时它工作正常:但是当我尝试在我的Xcode项目中使用它时,它给我一个编译错误:知道为什么会这样吗? 最佳答案