RosettaCodeData/Task/Reverse-a-string/Perl/reverse-a-string-2.pl

3 lines
104 B
Perl
Raw Permalink Normal View History

2013-04-10 23:57:08 -07:00
$string = "Jose\x{301}"; # "José" in NFD
$flip = join("", reverse $string =~ /\X/g); # becomes "ésoJ"