extension method

String extension()

Extracts the extension (without the leading dot) of self.file_name, if possible.

Implementation

String extension() {
  String extensionWithDot = _posix.extension(string);
  if (extensionWithDot.isNotEmpty) {
    assert(extensionWithDot.startsWith("."));
    return extensionWithDot.replaceFirst(".", "");
  }
  return extensionWithDot;
}