Skip to content

Instantly share code, notes, and snippets.

@tkausch
Created October 23, 2020 15:00
Show Gist options
  • Save tkausch/081d619133e95c0bd4ff0f903f44ff83 to your computer and use it in GitHub Desktop.
Save tkausch/081d619133e95c0bd4ff0f903f44ff83 to your computer and use it in GitHub Desktop.
How to read single letter in a string
extension String {
subscript(i: Int) -> String {
return String(self[index(startIndex, offsetBy: i)])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment