我设法解决了许多错误,但是我无法使此功能正常工作。
// Substring
func substring(_ start: Int, end: Int) -> String {
return self.substring(with: NSRange(self.characters.index(self.startIndex, offsetBy: start) ..< self.characters.index(self.startIndex, offsetBy: end)))
// error here "Type 'String._CharacterView.Index' (aka 'String.Index') does not conform to protocol 'FixedWidthInteger'"
}