Jump to content

Extract file extension: Difference between revisions

m
→‎{{header|Perl 6}}: Combine into a single file for ease of testing
(added Factor)
m (→‎{{header|Perl 6}}: Combine into a single file for ease of testing)
Line 1,091:
<lang perl6>sub extension (Str $path --> Str) {
$path.match(/:i ['.' <[a..z0..9]>+]? $ /).Str
}
}</lang>
 
# Testing:
 
<lang perl6>printf "%-35s %-11s %-12s\n", $_, extension($_).perl, $_.IO.extension.perl
for <
http://example.com/download.tar.gz
10,339

edits

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