I am trying to convert Swift 3 code into Swift 4. But this error shows:
"substring(from:)' is deprecated: Please use String slicing subscript with a 'partial range from' operator."
my code is :
extension String {
func substring(_ from: Int) -> String {
return self.substring(from: self.characters.index(self.startIndex, offsetBy: from))
}
}