Extract file extension: Difference between revisions

Content added Content deleted
No edit summary
No edit summary
Line 1,221: Line 1,221:
document.txt_backup ->
document.txt_backup ->
/etc/pam.d/login ->
/etc/pam.d/login ->
</pre>

=={{header|FutureBasic}}==
The underscores is a valid extension character in macOS and extensions are returned without leading dots.
<syntaxhighlight lang="futurebasic">include "NSLog.incl"

void local fn DoIt
CFArrayRef paths = @[@"http://example.com/download.tar.gz",@"CharacterModel.3DS",@".desktop",@"document",@"document.txt_backup",@"/etc/pam.d/login"]
CFStringRef path
for path in paths
NSLog(@"%@",fn StringPathExtension( path ))
next
end fn

fn DoIt

HandleEvents</syntaxhighlight>

{{Out}}
<pre>
gz
3DS
desktop
null
txt_backup
null
</pre>
</pre>


Line 1,255: Line 1,281:
mount.ecryptfs ecryptfs
mount.ecryptfs ecryptfs
....
....
</pre>


=={{header|FutureBasic}}==
The underscores is a valid extension character in macOS and extensions are returned without leading dots.
<syntaxhighlight lang="futurebasic">include "NSLog.incl"

void local fn DoIt
CFArrayRef paths = @[@"http://example.com/download.tar.gz",@"CharacterModel.3DS",@".desktop",@"document",@"document.txt_backup",@"/etc/pam.d/login"]
CFStringRef path
for path in paths
NSLog(@"%@",fn StringPathExtension( path ))
next
end fn

fn DoIt

HandleEvents</syntaxhighlight>

{{Out}}
<pre>
gz
3DS
desktop
null
txt_backup
null
</pre>
</pre>