Jump to content

Extract file extension: Difference between revisions

Add Plain English
No edit summary
(Add Plain English)
Line 2,111:
</pre>
 
=={{header|Plain English}}==
The 'Extract' imperative extracts parts of a path. When extracting an extension, it starts from the last period (.) in the path string and goes until the end of the string.
<syntaxhighlight lang="text">
To run:
Start up.
Show the file extension of "http://example.com/download.tar.gz".
Show the file extension of "CharacterModel.3DS".
Show the file extension of ".desktop".
Show the file extension of "document".
Show the file extension of "document.txt_backup".
Show the file extension of "/etc/pam.d/login".
Wait for the escape key.
Shut down.
 
To show the file extension of a path:
Extract an extension from the path.
Write the extension to the console.
</syntaxhighlight>
{{out}}
<pre>
.gz
.3DS
.desktop
 
.txt_backup
.d/login
</pre>
 
=={{header|PowerShell}}==
175

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.