📜  索引字符串 swift 代码示例

📅  最后修改于: 2022-03-11 15:01:03.735000             🧑  作者: Mango

代码示例1
let string = "Hello, World!"
let index = string.index(string.startIndex, offsetBy: 3)

print(string[index]) // Prints "l"

// This can be done in one line too:
print(string[string.index(string.startIndex, offsetBy: 3)])