How can I get the nth character of a string? I tried bracket([]) accessor with no luck.
[]
var string = \"Hello, world!\" var firstChar = string[
In Swift 5 without extension to the String :
String
var str = "ABCDEFGH" for char in str { if(char == "C") { } }
Above Swift code as same as that Java code :
Java
int n = 8; var str = "ABCDEFGH" for (int i=0; i