Extract file extension: Difference between revisions

m (added related tasks.)
Line 2,122:
"/etc/pam.d/login" -> ""
</pre>
 
=={{header|Smalltalk}}==
The Filename class has a convenient suffix method for that; so we convert the string to a filename and ask it:
<lang smalltalk>names := #(
'http://example.com/download.tar.gz'
'CharacterModel.3DS'
'.desktop'
'document'
'document.txt_backup'
'/etc/pam.d/login'
).
names do:[:f |
'%-35s -> %s\n' printf:{ f . f asFilename suffix } on:Stdout
]</lang>
{{out}}
<pre>http://example.com/download.tar.gz -> gz
CharacterModel.3DS -> 3DS
.desktop ->
document ->
document.txt_backup -> txt_backup
/etc/pam.d/login -> </pre>
 
=={{header|Tcl}}==
Anonymous user