Member predicate Files::Container::getExtension

Gets the extension of this container, that is, the suffix of its base name after the last dot character, if any.

In particular,

  • if the name does not include a dot, there is no extension, so this predicate has no result;
  • if the name ends in a dot, the extension is the empty string;
  • if the name contains multiple dots, the extension follows the last dot.

Here are some examples of absolute paths and the corresponding extensions (surrounded with quotes to avoid ambiguity):

Absolute pathExtension
"/bin/bash"not defined
string getExtension()