Hacker News new | ask | show | jobs
by viktorcode 1605 days ago
You certainly can. `print(String(flag.reversed()))` in Swift reverses emojis correctly.
1 comments

How does it handle the ASCII examples in https://news.ycombinator.com/item?id=30108184

And more importantly: What is the use case for a reversed string?

The use case: Make an animation, where the text appears starting from the end - for example if you stylize it as vertical text falling from the top.

I think the example shows quite clearly the problem really comes down to dividing the string to logical parts (atoms, grapheme clusters, however you want to call it).