Extract file extension: Difference between revisions
→{{header|C++}}: Shortened code a bit
Jazzedpineda (talk | contribs) (Add Plain English) |
(→{{header|C++}}: Shortened code a bit) |
||
Line 693:
=={{header|C++}}==
<syntaxhighlight lang="cpp">#include <
#include <
for (std::filesystem::path file : { "picture.jpg",
"myuniquefile.longextension",
"IAmAFileWithoutExtension",
else {▼
"/path/to.my/file",
"file.odd_one",
}</syntaxhighlight>▼
▲int main( ) {
▲ std::vector<std::string> filenames {"picture.jpg" , "http://mywebsite.com/picture/image.png" ,
▲ std::cout << filenames[i] << " has extension : " << extensions[i] << " !\n" ;
▲</syntaxhighlight>
{{out}}
<pre>picture.jpg has extension : jpg !
Line 732 ⟶ 716:
thisismine. has extension : !
</pre>
=={{header|Clojure}}==
|