File extension is in extensions list: Difference between revisions
Content deleted Content added
Undo revision 324498 by Drkameleon (talk) AWK solution taken out by mistake when editing Arturo solution. |
→{{header|Arturo}}: Restored latest Arturo solution. |
||
Line 186:
=={{header|Arturo}}==
in? extract.extension lower file
fileExtensions
]
▲<lang arturo>fileExtensions: #("zip" "rar" "7z" "gz" "archive" "A##")
▲hasExtension: @(file){
▲files: #("MyData.a##" "MyData.tar.Gz" "MyData.gzip" "MyData.7z.backup" "MyData..." "MyData")
▲loop files {
▲ print & + " => hasExtension: " + [hasExtension &]
{{out}}
<pre>MyData.a## => hasExtension?: true
MyData.tar.Gz => hasExtension?: true
MyData.gzip => hasExtension?: false
MyData.7z.backup => hasExtension?: false
MyData... => hasExtension?: false
MyData => hasExtension?: false </pre>
=={{header|AWK}}==
|