示例工程 03-strings-unicode

另有 1 个文件未随站点发布(平台工程、二进制或超过 200KB)。

03-strings-unicode/Diagnostics/IntIndex.swift

swift · 0.1 KB

// 故意编译失败:String 不能用 Int 下标。
// 复现:swiftc Diagnostics/IntIndex.swift
let text = "abc"
let first = text[0]
print(first)