RosettaCodeData/Task/Reverse-a-string/Ruby/reverse-a-string-2.rb

4 lines
95 B
Ruby

graphemes = 'as⃝df̅'.scan(/\X/)
reversed = graphemes.reverse
graphemes.join #=> "f̅ds⃝a"