Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Of course you can reverse a string with a flag emoji. You just need to treat a "string" as a collected of Extended Grapheme Clusters, and then you reverse the order of the EGCs. So if the string is `a<flag unicode bytes>b`, the output should be `b<flag unicode bytes>a`.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: