编辑代码

var str = "hello world"
print(str[str.index(str.endIndex, offsetBy:-5)])