Jump to content

Idiomatically determine all the lowercase and uppercase letters: Difference between revisions

m
→‎{{header|Perl}}: look beyond just ASCII
(Idiomatically determine all the lowercase and uppercase letters in various dialects BASIC)
m (→‎{{header|Perl}}: look beyond just ASCII)
Line 970:
 
=={{header|Perl}}==
<syntaxhighlight lang="perl">foruse $i (0v5..2**8-1) {12;
use utf8;
$c = chr $i;
binmode STDOUT, ':utf8';
 
my($lower,$upper);
 
for my $i (0..2**8-1) {
my $c = chr $i;
$lower .= $c if $c =~ /[[:lower:]]/;
$upper .= $c if $c =~ /[[:upper:]]/;
}
 
printsay "$lower\n";
printsay "$upper\n";</syntaxhighlight>
{{out}}
<pre>abcdefghijklmnopqrstuvwxyzªµºßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ
ABCDEFGHIJKLMNOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ</pre>
ABCDEFGHIJKLMNOPQRSTUVWXYZ</pre>
 
=={{header|Phix}}==
2,392

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.