Difference between revisions of "Fileext"
From NEC Retro
Scarred Sun (talk | contribs) (Created page with "<includeonly>{{#ifeq:{{#rpos:{{{1|}}}|.}}|-1||{{#sub:{{{1|}}}|{{#expr:{{#rpos:{{{1|}}}|.}}-{{#len:{{{1|}}}}}+1}}}}}}</includeonly><noinclude> This template returns the file ex...") |
Ccawley2011 (talk | contribs) |
||
Line 1: | Line 1: | ||
− | <includeonly>{{# | + | <includeonly>{{#if:{{#pos:{{{1|}}}|.}}|{{#explode:{{{1|}}}|.|-1}}}}</includeonly><noinclude> |
This template returns the file extension of a file link or url. | This template returns the file extension of a file link or url. | ||
− | == | + | ==Examples== |
− | < | + | {|class="prettytable" |
+ | ! Code || Result | ||
+ | |- | ||
+ | | | ||
+ | <pre>{{fileext|Filename.txt}}</pre> | ||
+ | | {{fileext|Filename.txt}} | ||
+ | |- | ||
+ | | | ||
+ | <pre>{{fileext|https://necretro.org/skins/foreground/assets/img/necretro-logo.png}}</pre> | ||
+ | | {{fileext|https://necretro.org/skins/foreground/assets/img/necretro-logo.png}} | ||
+ | |- | ||
+ | | | ||
+ | <pre>{{fileext|Not a file name}}</pre> | ||
+ | | {{fileext|Not a file name}} | ||
+ | |- | ||
+ | | | ||
+ | <pre>{{fileext|String ending with a stop.}}</pre> | ||
+ | | {{fileext|String ending with a stop.}} | ||
+ | |} | ||
− | + | [[Category:NEC Retro templates]]</noinclude> | |
− | |||
− | |||
− | |||
− | [[Category:NEC Retro templates |
Revision as of 15:26, 31 December 2021
This template returns the file extension of a file link or url.
Examples
Code | Result |
---|---|
{{fileext|Filename.txt}} |
txt |
{{fileext|https://necretro.org/skins/foreground/assets/img/necretro-logo.png}} |
png |
{{fileext|Not a file name}} |
|
{{fileext|String ending with a stop.}} |