Skip to content

Instantly share code, notes, and snippets.

@jweinst1
Created July 13, 2015 18:41
Show Gist options
  • Save jweinst1/d6f8694162bff4ced734 to your computer and use it in GitHub Desktop.
Save jweinst1/d6f8694162bff4ced734 to your computer and use it in GitHub Desktop.
Get's the character at a specific index in a string in swift
var speech = "Hello, playground"
func indexstring(str: String, index: Int) ->Character {
var strlist = Array(str)
return strlist[index]
}
indexstring(speech, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment