Filename extensions
Jump to navigation
Jump to search
Problem. It is often necessary to decide what to do with a file looking at the last part of its name: the extension. In some system extensions are fundamental (Windows), in some other just decoration you could also omit (Linux/Unix). How do I extract the extension from a filename?
Solution. by example
'/home/p/foo.bar' asFileEntry nameWithoutExtension . " => 'foo' " '/home/p/foo.bar' asFileEntry extension. "=> 'bar' " '/home/p/foo.bar.bazar' asFileEntry extension. "=> 'bazar' "