extension String { subscript(_ n: Int) -> Character { return self[self.index(self.startIndex, offsetBy: n)] } } let str = "Hello World" print(str[0]) // H print(str[4]) // o print(str[6]) // w