On Thursday, 26 March 2020 at 19:34:08 UTC, Quantium wrote:
    string s="abc";
    writeln(s[1]); // Should write 'b' or not???
Is it a legit code or it doesn't work ?

Yes, but keep in mind that char[] implies UTF8. Hence this won't work if your input contains e.g. chinese characters.

Refer to std.utf (https://dlang.org/phobos/std_utf.html) for some utilities to deal with UTF.

Reply via email to