Here are a few features that make it more objective-c like
func substringOfString(_ s: String, toIndex anIndex: Int) -> String { return s.substring(to: s.index(s.startIndex, offsetBy: anIndex)) } func substringOfString(_ s: String, fromIndex anIndex: Int) -> String { return s.substring(from: s.index(s.startIndex, offsetBy: anIndex)) }
applehelpwriter
source share