Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
11
Task/Reverse-a-string/Perl/reverse-a-string.pl
Normal file
11
Task/Reverse-a-string/Perl/reverse-a-string.pl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
use utf8;
|
||||
binmode STDOUT, ":utf8";
|
||||
|
||||
# to reverse characters (code points):
|
||||
print scalar reverse('visor'), "\n";
|
||||
|
||||
# to reverse graphemes:
|
||||
print join("", reverse "José" =~ /\X/g), "\n";
|
||||
|
||||
$string = 'ℵΑΩ 駱駝道 🤔 🇸🇧 🇺🇸 🇬🇧 👨👩👧👦🆗🗺';
|
||||
print join("", reverse $string =~ /\X/g), "\n";
|
||||
Loading…
Add table
Add a link
Reference in a new issue