import UIKit var str = "Hello" var newString = str + "Lucy" var newTypeString = NSString(string: newString) newTypeString.substringFromIndex(5) newTypeString.substringToIndex(5) newTypeString.substringWithRange(NSRange(location: 3,length: 5)) if newTypeString.containsString("Lucy"){ print("Hi") } newTypeString.componentsSeparatedByString("o") newTypeString.uppercaseString newTypeString.lowercaseString
原文链接:https://www.f2er.com/swift/324900.html