Anonymous user
File extension is in extensions list: Difference between revisions
File extension is in extensions list (view source)
Revision as of 13:16, 24 November 2019
, 4 years agoadded whitespace to the task's preamble, indented the tables, promoted from a draft task to a (full) task.
m (→{{header|REXX}}: changed some variable names and comments.) |
(added whitespace to the task's preamble, indented the tables, promoted from a draft task to a (full) task.) |
||
Line 1:
[[Category:String_manipulation]]
[[wp:Filename extension|Filename extensions]] are a rudimentary but commonly used way of identifying files types.
▲{{task heading}}
;Task:
Given an arbitrary filename and a list of extensions, tell whether the filename has one of those extensions.
Notes:
Line 22 ⟶ 25:
The following test cases all assume this list of extensions: <code>zip</code>, <code>rar</code>, <code>7z</code>, <code>gz</code>, <code>archive</code>, <code>A##</code>
:::::::: {| class="wikitable"
|-
! Filename
Line 42 ⟶ 45:
If your solution does the extra credit requirement, add <code>tar.bz2</code> to the list of extensions, and check the following additional test cases:
:::::::: {| class="wikitable"
|-
! Filename
Line 60 ⟶ 63:
For these reasons, this task exists in addition to the [[Extract file extension]] task.
{{task heading|Related tasks}}▼
* [[Extract file extension]]
* [[String matching]]
<br><br>
=={{header|11l}}==
|