fileExtension property

String? get fileExtension

Gets the file extension from this path (without dot)

includeDot Whether to include the dot in the extension (defaults to false)

Returns the file extension or null if not found

Example:

print('/path/to/document.pdf'.fileExtension); // "pdf"
print('/path/to/document.pdf'.fileExtensionWithDot); // ".pdf"

Implementation

String? get fileExtension => QFileInfoUtils.getExtension(this);