How can I get the nth character of a string? I tried bracket([]) accessor with no luck.
[]
var string = \"Hello, world!\" var firstChar = string[
I just had the same issue. Simply do this:
var aString: String = "test" var aChar:unichar = (aString as NSString).characterAtIndex(0)