File extension is in extensions list: Difference between revisions
Content added Content deleted
(Undo revision 324498 by Drkameleon (talk) AWK solution taken out by mistake when editing Arturo solution.) |
(→{{header|Arturo}}: Restored latest Arturo solution.) |
||
Line 186: | Line 186: | ||
=={{header|Arturo}}== |
=={{header|Arturo}}== |
||
⚫ | |||
⚫ | |||
in? extract.extension lower file |
|||
fileExtensions |
|||
] |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
lowercased: map fileExtensions => lowercase |
|||
contains lowercased [lowercase|replace [pathExtension file] "." ""] |
|||
} |
|||
⚫ | |||
⚫ | |||
⚫ | |||
}</lang> |
|||
{{out}} |
{{out}} |
||
<pre>MyData.a## => hasExtension: true |
<pre>MyData.a## => hasExtension?: true |
||
MyData.tar.Gz => hasExtension: true |
MyData.tar.Gz => hasExtension?: true |
||
MyData.gzip => hasExtension: false |
MyData.gzip => hasExtension?: false |
||
MyData.7z.backup => hasExtension: false |
MyData.7z.backup => hasExtension?: false |
||
MyData... => hasExtension: false |
MyData... => hasExtension?: false |
||
MyData => hasExtension: false</pre> |
MyData => hasExtension?: false </pre> |
||
=={{header|AWK}}== |
=={{header|AWK}}== |