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?