Path.suffix

string suffix() const @safe

Return the last file suffix (extension) including the leading dot.

Semantics are modeled after Python's pathlib:

  • Returns the last suffix including the leading dot, e.g., "archive.tar.gz" → ".gz".
  • Returns an empty string when there is no suffix.
  • Dotfiles without any additional dots (e.g., ".bashrc") are considered to have

no suffix: this returns an empty string and the entire name is the stem.

Returns

The last file suffix (including the dot), or an empty string if none.