Task: Iterate over a string and print each character.... Without using external libraries.
func main() {
var s string = "hππ»e"
for i, c := range []rune(s) {
fmt.Println(i, string(c))
}
}
This prints:
0 h
1 π
2 π»
3 e
What it should print instead:
0 h
1 ππ»
2 e
So, can you make this work?
Hint: The emoji used in string is skin-toned, not default.
Top comments (2)
This has nothing to do with GoLang, rather is has to do with ascii emoji encoding and fonts
But, can you make it work?